Make the js "break" even better.

This commit is contained in:
The Ghost of FOSS' Past 2024-10-25 11:34:45 -05:00
parent 25dae54410
commit 5f280254fa

2
qjs.c
View file

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