fix: assert module in the renderer process#39540
Conversation
|
This looks good but I want to ask about this line:
I'm wondering if it's possible to ensure the WeakMap somehow is always initialized whether or not the function is overridden; and if so, whether that would be simpler than the approach in this PR? I haven't read the assert module -- if the above idea isn't practical or is more complex then this fix LGTM. |
|
@ckerr sorry, i should have phrased that better. It is initialized - it's never populated which means that |
199a387 to
d8c97df
Compare
|
Upstream PR: nodejs/node#49212 |
|
Release Notes Persisted
|
|
I have automatically backported this PR to "24-x-y", please check out #39621 |
|
I have automatically backported this PR to "25-x-y", please check out #39622 |
|
I have automatically backported this PR to "27-x-y", please check out #39623 |
|
I have automatically backported this PR to "26-x-y", please check out #39624 |
Description of Change
Closes #39079.
When creating a Node.js Environment, embedders have the option to disable Node.js' default overriding of
Error.prepareStackTrace. However, theassertmodule depends on a WeakMap that is populated with the error stacktraces in the overridden function.This adds handling to fall back to the default implementation if
Error.prepareStackTraceif the override has been disabled.This will be upstreamed.
Checklist
npm testpassesRelease Notes
Notes: Fixes an issue where the Node.js
assertmodule did not work in the renderer process.