Skip to content
Snippets Groups Projects
Commit d6ecc4b6 authored by Cheng Shao's avatar Cheng Shao
Browse files

wasm: fix safari console error message related to import("node:timers")

This patch fixes the wasm backend JSFFI prelude script to avoid
calling `import("node:timers")` on non-deno hosts. Safari doesn't like
it and would print an error message to the console. Fixes
https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/issues/13.

(cherry picked from commit 301c3b54)
parent 8421517f
No related branches found
No related tags found
No related merge requests found
......@@ -58,9 +58,9 @@ const setImmediate = await (async () => {
}
// deno
try {
if (globalThis.Deno) {
return (await import("node:timers")).setImmediate;
} catch {}
}
// https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/postTask
if (globalThis.scheduler) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment