From f7e5203a20ef41cf9bc59d339b4f85007a7f3764 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 15 May 2017 17:20:06 +1000 Subject: Separate ZIO and MBuffer data structures - lua_load no longer takes a null reader function --- tests/lapi.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/lapi.js') 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")); -- cgit v1.2.3-54-g00ecf