[Git][ghc/ghc][master] wasm: fix safari console error message related to import("node:timers")
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Sun Oct 27 09:38:28 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
301c3b54 by Cheng Shao at 2024-10-27T05:37:49-04:00
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.
- - - - -
1 changed file:
- utils/jsffi/prelude.mjs
Changes:
=====================================
utils/jsffi/prelude.mjs
=====================================
@@ -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) {
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/301c3b541de825b76cff59c739a8797b64321d1a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/301c3b541de825b76cff59c739a8797b64321d1a
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241027/3f678ac3/attachment.html>
More information about the ghc-commits
mailing list