@@ -165,18 +165,12 @@ const lauxBindings: Record<string, lauxBindingFactoryFunc> = {
165
165
return ( this as LauxLib ) . luaL_loadstring ( L , s ) || lua . lua_pcall ( L , 0 , LUA_MULTRET , 0 ) ;
166
166
} ,
167
167
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 ) ;
173
169
} ,
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" ] ) ,
176
170
luaL_newstate : luaGlue . cwrap ( "lua_open" , "number" , [ ] ) ,
177
171
}
178
172
} ,
179
- "5.1.x" : function ( luaGlue : LuaEmscriptenModule , _lua : Lua ) {
173
+ "<= 5.1.x" : function ( luaGlue : LuaEmscriptenModule , _lua : Lua ) {
180
174
return {
181
175
luaL_loadbuffer : luaGlue . cwrap ( "luaL_loadbuffer" , "number" , [ "number" , "string" , "number" , "string" ] ) ,
182
176
}
0 commit comments