Commit 2353a5a
fix(ext/node): wrap non-Error unhandled rejections in ERR_UNHANDLED_REJECTION (#32535)
## Summary
- When a promise is rejected with a non-Error value (e.g.
`Promise.reject(null)`) and there are no `unhandledRejection` listeners,
Node.js wraps the rejection reason in an `ERR_UNHANDLED_REJECTION` error
before routing it to `uncaughtException`. Deno was passing the raw value
directly, which caused crashes when exception handlers accessed
`.message` or `.name`.
- This fixes `test-promise-unhandled-default.js` in the node compat test
suite (also unblocks `test-promise-unhandled-throw.js` which tests the
same wrapping logic under `--unhandled-rejections=throw`).
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent e8a3cfa commit 2353a5a
1 file changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | | - | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1090 | 1112 | | |
1091 | 1113 | | |
1092 | 1114 | | |
| |||
0 commit comments