summaryrefslogtreecommitdiff
path: root/tests/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 /tests/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 'tests/lapi.js')
-rw-r--r--tests/lapi.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/lapi.js b/tests/lapi.js
index 8b269b1..b739860 100644
--- a/tests/lapi.js
+++ b/tests/lapi.js
@@ -375,7 +375,7 @@ test('lua_load and lua_call it', function (t) {
L = lauxlib.luaL_newstate();
- lua.lua_load(L, null, bc, lua.to_luastring("test-lua_load"), lua.to_luastring("binary"));
+ lua.lua_load(L, function(L, s) { let r = s.bc; s.bc = null; return r; }, {bc: bc}, lua.to_luastring("test-lua_load"), lua.to_luastring("binary"));
lua.lua_call(L, 0, 1);
@@ -398,11 +398,9 @@ test('lua script reads js upvalues', function (t) {
t.doesNotThrow(function () {
- let bc = toByteCode(luaCode);
-
L = lauxlib.luaL_newstate();
- lua.lua_load(L, null, bc, lua.to_luastring("test-lua_load"), lua.to_luastring("binary"));
+ lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
lua.lua_pushliteral(L, "hello");
lua.lua_setglobal(L, lua.to_luastring("js"));