summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-15 17:20:06 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-15 17:20:06 +1000
commitf7e5203a20ef41cf9bc59d339b4f85007a7f3764 (patch)
tree3c6f0907231588f528902eec3b2b1d09d19a53e1 /src/lapi.js
parent3947c2cb2fa6193645ac30898064e3d335a63545 (diff)
downloadfengari-f7e5203a20ef41cf9bc59d339b4f85007a7f3764.tar.gz
fengari-f7e5203a20ef41cf9bc59d339b4f85007a7f3764.tar.bz2
fengari-f7e5203a20ef41cf9bc59d339b4f85007a7f3764.zip
Separate ZIO and MBuffer data structures
- lua_load no longer takes a null reader function
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index 8897fb2..885dd8f 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -7,7 +7,6 @@ const ldebug = require('./ldebug.js');
const ldo = require('./ldo.js');
const ldump = require('./ldump.js');
const lfunc = require('./lfunc.js');
-const llex = require('./llex.js');
const lobject = require('./lobject.js');
const lstate = require('./lstate.js');
const lstring = require('./lstring.js');
@@ -15,6 +14,7 @@ const ltm = require('./ltm.js');
const luaconf = require('./luaconf.js');
const lvm = require('./lvm.js');
const ltable = require('./ltable.js');
+const lzio = require('./lzio.js');
const MAXUPVAL = lfunc.MAXUPVAL;
const CT = defs.constant_types;
const TS = defs.thread_status;
@@ -891,8 +891,8 @@ const lua_arith = function(L, op) {
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 = [defs.char["?"]];
+ let z = new lzio.ZIO(L, reader, data);
let status = ldo.luaD_protectedparser(L, z, chunckname, mode);
if (status === TS.LUA_OK) { /* no errors? */
let f = L.stack[L.top - 1].value; /* get newly created function */