-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I am trying to redirect stdout to a <pre>, so I did
const handleExecute = async () => {
setOutput('')
try {
const lua = await getLuaState()
const _G = lua.getGlobalTable()
// const io = _G.get('io') as LuaTable
_G.set('print', (args: any) => {
console.log({ args })
setOutput((prev) => prev + args + '\n')
console.log("print(): " + args)
})
await lua.run(code);
} catch (error: any) {
setOutput("Error: " + error.message)
}
}however args seems to be undefined for any input
Metadata
Metadata
Assignees
Labels
No labels