[Git][ghc/ghc][master] wasm: use import.meta.main for proper distinction of nodejs main modules
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 039f1977 by Cheng Shao at 2026-02-13T06:27:47-05:00 wasm: use import.meta.main for proper distinction of nodejs main modules This patch uses `import.meta.main` for proper distinction of nodejs main modules, especially when the main module might be installed as a symlink. Fixes #26916. - - - - - 2 changed files: - utils/jsffi/dyld.mjs - utils/jsffi/post-link.mjs Changes: ===================================== utils/jsffi/dyld.mjs ===================================== @@ -1470,7 +1470,7 @@ async function nodeMain({ searchDirs, mainSoPath, outFd, inFd, args }) { ); } -const isNodeMain = isNode && import.meta.filename === process.argv[1]; +const isNodeMain = isNode && import.meta.main; // node iserv as invoked by // GHC.Runtime.Interpreter.Wasm.spawnWasmInterp ===================================== utils/jsffi/post-link.mjs ===================================== @@ -119,7 +119,7 @@ function isMain() { return false; } - return import.meta.filename === process.argv[1]; + return import.meta.main; } async function main() { View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/039f19778e35b193af0de2a2c6ed8955... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/039f19778e35b193af0de2a2c6ed8955... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)