Im using the lua.vm.js javascript library in order to get some Lua code to execute in JavaScript.
The code works fine(its a very simple Lua example) but I cant get any variables declared in Lua into my JavaScript context.
The REPL from the project allows me to test the following Lua code:
local key = { k1 = value}
local data = {
[key] = "something",
a = { b = 3 },
}
local v1 = data [key]
local v2 = data.a.b
print(v1)
print(v2)
In the output window, I can see that v1 and v2 are being printed and with the correct value, but I cant find a way to assign the value from data, for example, into a JS variable.
A little more simple: Get the values from the key and data into javascript variables after executing the Lua code.
Is that possible?
I'm reading the code from lua.vm.js but I cant find that guides me in the right direction.
Thanks in advance!