@@ -165,18 +165,12 @@ const lauxBindings: Record<string, lauxBindingFactoryFunc> = {
165165 return ( this as LauxLib ) . luaL_loadstring ( L , s ) || lua . lua_pcall ( L , 0 , LUA_MULTRET , 0 ) ;
166166 } ,
167167 luaL_loadstring : function ( L : LuaState , s : string ) {
168- const lastStack = luaGlue . stackSave ( ) ;
169- const cstr = luaGlue . allocateUTF8OnStack ( s ) as unknown ;
170- const result = ( this as LauxLib ) . luaL_loadbuffer ( L , cstr as string , luaGlue . lengthBytesUTF8 ( s ) , s ) ;
171- luaGlue . stackRestore ( lastStack ) ;
172- return result ;
168+ return ( this as LauxLib ) . luaL_loadbuffer ( L , s , luaGlue . lengthBytesUTF8 ( s ) , s ) ;
173169 } ,
174- // Note that s has a "number" type, so we can pass a raw pointer
175- luaL_loadbuffer : luaGlue . cwrap ( "luaL_loadbuffer" , "number" , [ "number" , "number" , "number" , "string" ] ) ,
176170 luaL_newstate : luaGlue . cwrap ( "lua_open" , "number" , [ ] ) ,
177171 }
178172 } ,
179- "5.1.x" : function ( luaGlue : LuaEmscriptenModule , _lua : Lua ) {
173+ "<= 5.1.x" : function ( luaGlue : LuaEmscriptenModule , _lua : Lua ) {
180174 return {
181175 luaL_loadbuffer : luaGlue . cwrap ( "luaL_loadbuffer" , "number" , [ "number" , "string" , "number" , "string" ] ) ,
182176 }
0 commit comments