object-lua icon indicating copy to clipboard operation
object-lua copied to clipboard

Lua 5.2 Compatability

Open mhalenza opened this issue 12 years ago • 2 comments

objectlua doesn't work with Lua 5.2 due to the change in how environments work. function addSuper in bootstrap.lua uses getfenv() and setfenv() functions that don't exist in Lua 5.2

mhalenza avatar Jun 06 '13 15:06 mhalenza

Thanks, I'll have a look.

sroccaserra avatar Jun 06 '13 15:06 sroccaserra

Ok, in Lua 5.2 externally injecting a super variable from outside a function seems only possible through debug.getupvalue() :

http://lua-users.org/lists/lua-l/2010-06/msg00313.html

But I don't like the idea to use the debug lib for this.

And I have no idea how to use _ENV or simpler constructs from outside a function to achieve the same functionnality.

Then unfortunately, I don't use Lua anymore since 5.1, so I guess I'm not up to the task. Sorry about that.

sroccaserra avatar Sep 10 '13 17:09 sroccaserra