From f28c4fb81f2de81470a739be1bc15e5158d10de0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 11 Dec 2017 17:05:27 +1100 Subject: src/lapi.js: Factor out default chunkname --- src/lapi.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lapi.js b/src/lapi.js index 0c1a3a6..c1952dd 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -914,8 +914,9 @@ const lua_arith = function(L, op) { ** 'load' and 'call' functions (run Lua code) */ +const default_chunkname = defs.to_luastring("?"); const lua_load = function(L, reader, data, chunkname, mode) { - if (!chunkname) chunkname = [defs.char["?"]]; + if (!chunkname) chunkname = default_chunkname; 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); -- cgit v1.2.3-70-g09d2