From 15e5dbb494dcb013031723eee6d8b0dcd8093d2a Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 11 Dec 2017 15:50:21 +1100 Subject: src/loadlib.js: Fix incorrect type of LUA_IGMARK --- src/loadlib.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/loadlib.js') diff --git a/src/loadlib.js b/src/loadlib.js index cae377f..a64f1c3 100644 --- a/src/loadlib.js +++ b/src/loadlib.js @@ -4,12 +4,12 @@ const fengari = require('./fengari.js'); const lua = require('./lua.js'); const lauxlib = require('./lauxlib.js'); -const LUA_IGMARK = ["-".charCodeAt(0)]; - const CLIBS = lua.to_luastring("__CLIBS__", true); const LUA_PATH_VAR = "LUA_PATH"; const LUA_CPATH_VAR = "LUA_CPATH"; +const LUA_IGMARK = "-"; + /* ** LUA_CSUBSEP is the character that replaces dots in submodule names ** when searching for a C loader. @@ -323,7 +323,7 @@ const searcher_Lua = function(L) { const loadfunc = function(L, filename, modname) { let openfunc; modname = lauxlib.luaL_gsub(L, modname, [".".charCodeAt(0)], LUA_OFSEP); - let mark = modname.indexOf(LUA_IGMARK[0]); + let mark = modname.indexOf(LUA_IGMARK.charCodeAt(0)); if (mark >= 0) { openfunc = lua.lua_pushlstring(L, modname, mark); openfunc = lua.lua_pushfstring(L, lua.to_luastring("%s%s"), LUA_POF, openfunc); -- cgit v1.2.3-54-g00ecf