diff options
author | daurnimator <quae@daurnimator.com> | 2017-12-02 02:35:06 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-12-02 02:35:06 +1100 |
commit | 2de7580fb1109c5342de0088c174eec634594c00 (patch) | |
tree | 0f40ab7d3b28e1b7a41badbcf7ae4b564b812300 /src/loadlib.js | |
parent | c8d6c4323c62c38a4fad40642cd9db166caa910a (diff) | |
download | fengari-2de7580fb1109c5342de0088c174eec634594c00.tar.gz fengari-2de7580fb1109c5342de0088c174eec634594c00.tar.bz2 fengari-2de7580fb1109c5342de0088c174eec634594c00.zip |
Export strings from lauxlib in lua string form (rather than as javascript string)
Diffstat (limited to 'src/loadlib.js')
-rw-r--r-- | src/loadlib.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/loadlib.js b/src/loadlib.js index 49f2715..dbd5c3c 100644 --- a/src/loadlib.js +++ b/src/loadlib.js @@ -366,7 +366,7 @@ const searcher_Croot = function(L) { const searcher_preload = function(L) { let name = lauxlib.luaL_checkstring(L, 1); - lua.lua_getfield(L, lua.LUA_REGISTRYINDEX, lua.to_luastring(lauxlib.LUA_PRELOAD_TABLE, true)); + lua.lua_getfield(L, lua.LUA_REGISTRYINDEX, lauxlib.LUA_PRELOAD_TABLE); if (lua.lua_getfield(L, -1, name) === lua.LUA_TNIL) /* not found? */ lua.lua_pushfstring(L, lua.to_luastring("\n\tno field package.preload['%s']"), name); return 1; @@ -411,7 +411,7 @@ const findloader_cont = function(L, status, ctx) { const ll_require = function(L) { let name = lauxlib.luaL_checkstring(L, 1); lua.lua_settop(L, 1); /* LOADED table will be at index 2 */ - lua.lua_getfield(L, lua.LUA_REGISTRYINDEX, lua.to_luastring(lauxlib.LUA_LOADED_TABLE, true)); + lua.lua_getfield(L, lua.LUA_REGISTRYINDEX, lauxlib.LUA_LOADED_TABLE); lua.lua_getfield(L, 2, name); /* LOADED[name] */ if (lua.lua_toboolean(L, -1)) /* is it there? */ return 1; /* package is already loaded */ @@ -486,10 +486,10 @@ const luaopen_package = function(L) { lua.LUA_EXEC_DIR + "\n" + LUA_IGMARK + "\n"); lua.lua_setfield(L, -2, lua.to_luastring("config", true)); /* set field 'loaded' */ - lauxlib.luaL_getsubtable(L, lua.LUA_REGISTRYINDEX, lua.to_luastring(lauxlib.LUA_LOADED_TABLE, true)); + lauxlib.luaL_getsubtable(L, lua.LUA_REGISTRYINDEX, lauxlib.LUA_LOADED_TABLE); lua.lua_setfield(L, -2, lua.to_luastring("loaded", true)); /* set field 'preload' */ - lauxlib.luaL_getsubtable(L, lua.LUA_REGISTRYINDEX, lua.to_luastring(lauxlib.LUA_PRELOAD_TABLE, true)); + lauxlib.luaL_getsubtable(L, lua.LUA_REGISTRYINDEX, lauxlib.LUA_PRELOAD_TABLE); lua.lua_setfield(L, -2, lua.to_luastring("preload", true)); lua.lua_pushglobaltable(L); lua.lua_pushvalue(L, -2); /* set 'package' as upvalue for next lib */ |