Open paulcuth opened 10 years ago
The init code in the Tessel runtime modifies the Function metatable to simulate JavaScript semantics where everything is an object. Functions get a hidden table that holds properties that appear to be on the function.
https://github.com/tessel/runtime/blob/master/src/colony/lua/colony-init.lua#L280
You'll need the Lua in that directory to get a functioning JS environment.
(I've edited the title for the actionable issue on this repository)
Hi,
I'm currently looking at using Colony outside of the Tessel ecosystem and I'm unable to output working Lua code.
For example, if we execute the following JavaScript in Node...
... it outputs the following Lua in
output.lua
(module wrapping omitted)...This fails to run in Lua 5.1, 5.2 and LuaJIT because it tries to add a
name
property to a function. It produces the following error:Is this expected behaviour? Am I using different versions of Lua than you? Do you have a custom build of Lua where adding properties to functions is allowed?