Closed deltaflux closed 12 years ago
Thanks for pointing this out. This is definitely a bug, a regression that occurred a while back.
The fix I committed is a little different then yours though, lua_load itself needs to add the "return G;" since the code in lua.jison does not include the wrapper around generated code. If you look at lua2js_end you'll see it includes the "return G" itself.
While trying to use lua+parser.js I noticed that the load() function created by lua_load() would never actually return the G variable that it creates, meaning that I couldn't access the data. With this change my usage is
var luaLoaderFunction = lua_load(luaScript); var luaObject = luaLoaderFunction();
Let me know if I've misunderstood how to use lua_load() and this fix is incorrect. Thanks.