diff --git a/qjs.c b/qjs.c index be8a21d..60a6dcd 100644 --- a/qjs.c +++ b/qjs.c @@ -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"