Add some more extensions from Lua 5.2/5.3.

Contributed by François Perrad.
This commit is contained in:
Mike Pall
2017-01-17 11:37:28 +01:00
parent ed4ce98ac1
commit c198167690
7 changed files with 56 additions and 11 deletions

View File

@@ -589,6 +589,10 @@ LUALIB_API int luaopen_package(lua_State *L)
lj_lib_pushcf(L, package_loaders[i], 1);
lua_rawseti(L, -2, i+1);
}
#if LJ_52
lua_pushvalue(L, -1);
lua_setfield(L, -3, "searchers");
#endif
lua_setfield(L, -2, "loaders");
lua_getfield(L, LUA_REGISTRYINDEX, "LUA_NOENV");
noenv = lua_toboolean(L, -1);