Closed Burperino closed 1 year ago
Can you make a minimal repro?
It didn't appear in the minimal reproduction, so I think it was a problem in the bigger project. Anyway, thank you for your time.
Did the bigger project include electron by any chance? The way I get the error is when electron calls a lua event callback function.
For example:
BrowserWindow:on(
"ready-to-show",
function ()
-- Code that does not execute because of the error
end
)
@CoreBytee do you have a minimal repro?
I will try to make one later next week
I am trying to integrate lua in a project of mine, but it requires a lot of asynchronous code. I made a 'sleep' function to test whether working with asynchronous code would work. It is registered as a function, but when I run it it gives me a memory out of bounds error. The lua vm works fine. The function works in javascript.
vm.js:
lua.global.set('sleep', sleep);
utils.js:
const sleep = (m) => new Promise((r, rj) => setTimeout(r, m)); // Yes this is exported
test.lua:
sleep(1000):await()
The error: wasm://wasm/000f64ae:1 RuntimeError: memory access out of bounds
If I don't include the :await() it works, but it doesn't wait for the promise to get resolved.
print(sleep(1000))
results injs_promise
Did I do something wrong?
Thank you for your time.