patch up timeout code

This commit is contained in:
Arma-Damna-Dillo 2024-10-25 10:07:31 -05:00
parent d868f20e80
commit 25dae54410

2
qjs.c
View file

@ -531,7 +531,7 @@ int main(int argc, char **argv)
"\n"
"if (typeof os !== 'undefined') {\n"
" globalThis.sleep = os.sleep;\n"
" async function setTimeout(func, ms) { await sleep(ms); Function(func)(); }\n"
" async function setTimeout(func, ms) { await sleep(ms); return func(); }\n"
" globalThis.setTimeout = setTimeout\n"
"} else {\n"
" console.error('os is not defined.');\n"