summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-30 11:58:09 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-03-30 14:39:19 +0200
commit3813f2d43054708bab7221a5ca74a0183a2ebcaf (patch)
tree2e27bc81114099cbf94b18e2c139843e66db6b53 /src/lapi.js
parent456ab7b69f88859683c60cc2261e70d6dbadd8e8 (diff)
downloadfengari-3813f2d43054708bab7221a5ca74a0183a2ebcaf.tar.gz
fengari-3813f2d43054708bab7221a5ca74a0183a2ebcaf.tar.bz2
fengari-3813f2d43054708bab7221a5ca74a0183a2ebcaf.zip
8-bit only in lstrlib
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lapi.js b/src/lapi.js
index e7fbf4f..a7d7033 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -748,8 +748,10 @@ const lua_rawequal = function(L, index1, index2) {
*/
const lua_load = function(L, reader, data, chunckname, mode) {
+ assert(Array.isArray(chunckname), "lua_load expect an array of byte as chunckname");
+ assert(mode ? Array.isArray(mode) : true, "lua_load expect an array of byte as mode");
let z = new llex.MBuffer(L, data, reader);
- if (!chunckname) chunckname = "?";
+ if (!chunckname) chunckname = [lua.char["?"]];
let status = ldo.luaD_protectedparser(L, z, chunckname, mode);
if (status === TS.LUA_OK) { /* no errors? */
let f = L.stack[L.top - 1]; /* get newly created function */