From 5f280254fa3f0efcfb178ec07f05e5a3ed27d2cf Mon Sep 17 00:00:00 2001 From: Sneed Group Holder Date: Fri, 25 Oct 2024 11:34:45 -0500 Subject: [PATCH] Make the js "break" even better. --- qjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qjs.c b/qjs.c index 60a6dcd..0254aa2 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); 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" "} else {\n" " console.error('os is not defined.');\n"