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
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, theassert
module 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.prepareStackTrace
if the override has been disabled.This will be upstreamed.
Checklist
npm test
passesRelease Notes
Notes: Fixes an issue where the Node.js
assert
module did not work in the renderer process.