From aa1a44c84f11f97f6614b9c2fd252fddec4067eb Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 20 Nov 2017 16:12:08 +1100 Subject: src/lapi.js: chunkname can be null --- src/lapi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lapi.js b/src/lapi.js index 1be0837..be80672 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -912,9 +912,9 @@ const lua_arith = function(L, op) { */ const lua_load = function(L, reader, data, chunkname, mode) { - assert(defs.is_luastring(chunkname), "lua_load expect an array of byte as chunkname"); - assert(mode ? defs.is_luastring(mode) : true, "lua_load expect an array of byte as mode"); if (!chunkname) chunkname = [defs.char["?"]]; + else assert(defs.is_luastring(chunkname), "lua_load expect an array of byte as chunkname"); + assert(mode ? defs.is_luastring(mode) : true, "lua_load expect an array of byte as mode"); let z = new lzio.ZIO(L, reader, data); let status = ldo.luaD_protectedparser(L, z, chunkname, mode); if (status === TS.LUA_OK) { /* no errors? */ -- cgit v1.2.3-70-g09d2