Can not get lua error in coroutine
coconutxin opened this issue · 1 comments
coconutxin commented
const lua = await factory.createEngine()
lua.doStringSync(`
local co = coroutine.create(function()
local a
a = a + 1
print(a)
end)
coroutine.resume(co)
`)
await lua.doString(`
local co = coroutine.create(function()
local a
a = a + 1
print(a)
end)
coroutine.resume(co)
`)
The above code can not throw error.
Both lua_resume and lua_pcall are not returning error.
It is very strange.
coconutxin commented
Oh, I can get the error message by coroutine.resume.
print(coroutine.resume(co))