Compare commits
2 commits
25dae54410
...
af4c40ce41
Author | SHA1 | Date | |
---|---|---|---|
af4c40ce41 | |||
5f280254fa |
1 changed files with 3 additions and 2 deletions
5
qjs.c
5
qjs.c
|
@ -528,11 +528,12 @@ int main(int argc, char **argv)
|
|||
"globalThis.global = globalThis;\n"
|
||||
"global.console.error = console.log\n"
|
||||
"global.console.warn = console.log\n"
|
||||
"globalThis.break = () => { throw new Error('Break'); };\n"
|
||||
"\n"
|
||||
"if (typeof os !== 'undefined') {\n"
|
||||
" globalThis.sleep = os.sleep;\n"
|
||||
" async function setTimeout(func, ms) { await sleep(ms); return func(); }\n"
|
||||
" globalThis.setTimeout = setTimeout\n"
|
||||
" async function setTimeout2(func, ms) {globalThis.clearTimeout = false; await sleep(ms); if (!clearTimeout) { func(); } }\n"
|
||||
" globalThis.setTimeout = setTimeout2\n"
|
||||
"} else {\n"
|
||||
" console.error('os is not defined.');\n"
|
||||
"}\n"
|
||||
|
|
Loading…
Reference in a new issue