-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esm: handle more error types thrown from the loader thread #48247
Conversation
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
The new test-cases seem a bit verbose; could they be DRY'd up with a loop (for (const valid of […])
and possibly for (const invalid of […])
)?
if (status === 'success' || body === null || | ||
(typeof body !== 'object' && | ||
typeof body !== 'function' && | ||
typeof body !== 'symbol')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
if (status === 'success' || body === null || | |
(typeof body !== 'object' && | |
typeof body !== 'function' && | |
typeof body !== 'symbol')) { | |
if (status === 'success' || body === null || | |
(typeof body !== 'object' && | |
typeof body !== 'function' && | |
typeof body !== 'symbol') | |
) { |
There are on the same structure than almost every other test cases in that file, that seems fine to me. IMO test code should be WET code, not DRY. |
Landed in d28f1f1 |
PR-URL: nodejs#48247 Refs: nodejs#48240 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jacob Smith <jacob@frende.me>
This is blocked by another PR that needs to be backported to v18.x because it references missing code. |
For reference, backporting this is blocked until #44710 is backported. |
PR-URL: nodejs#48247 Refs: nodejs#48240 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jacob Smith <jacob@frende.me>
PR-URL: nodejs#48247 Refs: nodejs#48240 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jacob Smith <jacob@frende.me>
PR-URL: nodejs#48247 Refs: nodejs#48240 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jacob Smith <jacob@frende.me>
PR-URL: nodejs/node#48247 Backport-PR-URL: nodejs/node#50669 Refs: nodejs/node#48240 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jacob Smith <jacob@frende.me>
PR-URL: nodejs/node#48247 Backport-PR-URL: nodejs/node#50669 Refs: nodejs/node#48240 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jacob Smith <jacob@frende.me>
Refs: #48240