ES module loading inconsistent with browser while handling undefined
exceptions
#19281
Labels
esm
Issues and PRs related to the ECMAScript Modules implementation.
If a module throws
undefined
, and another module imports it, it should catchundefined
, like that in browser.Browser Test
Make 2 files "index.html" and "aaa.mjs".
index.html:
aaa.mjs:
It will output
"bad undefined"
. You can also visit my temporary page for this test: https://zzz-shadow.github.io/Node.js Test
Make 2 files "test.mjs" and "aaa.mjs".
test.mjs:
aaa.mjs:
When running test.mjs, it will output:
So, in Node, when a module throws
undefined
ornull
, the thing caught isn't the thing it throws.Static imports are also affected.
The text was updated successfully, but these errors were encountered: