Closed cristiano-belloni closed 7 years ago
print(x) outputs [object global], which is the same object as js.global (printing the key/value pairs in x confirms that).
The first argument passed by JS is this
.
Try:
function foo(this, x)
print(x)
end
@cristiano-belloni consider joining #fengari on freenode for those quick questions
@daurnimator Thanks! @giann Will do.
So if I have this code in lua:
And I call
global.foo
in my js script with an argument:print(x)
outputs[object global]
, which is the same object asjs.global
(printing the key/value pairs inx
confirms that).Is there a way to pass args from js to Lua with interop?