add string manipulation library to std table in LuaJIT

This commit is contained in:
falsycat 2022-10-29 22:54:43 +09:00
parent 0cb8468a58
commit 20b5217869

View File

@ -147,6 +147,12 @@ inline void PushStdTable(lua_State* L) noexcept {
luaL_loadstring(L, "return require(\"bit\")");
lua_call(L, 0, 1);
lua_setfield(L, -2, "bit");
// ---- str manip ----
luaL_openlibs(L);
luaL_loadstring(L, "return string");
lua_call(L, 0, 1);
lua_setfield(L, -2, "str");
}
lua_setfield(L, -2, "__index");
lua_setmetatable(L, -2);