-
Notifications
You must be signed in to change notification settings - Fork 885
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: avoid override mistake #1939
Conversation
Can you add a test? |
Done. The added
|
The
is exactly the symptom we saw in our own system that led us here. |
@mcollina Thanks for considering this change. |
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.
lgtm
There’s a test failure affecting only Windows. Can I trouble a maintainer to re-run that to verify whether this is a flake? |
It's the transport tests. I wish I knew why they consistently fail as often as they do. But we can just ignore it for this. |
Thanks! |
The assignment at this location was to a
self
object that inherits from theconsole
(or what was theconsole
before this code ran). This assignment was use to override properties typically inherited fromconsole
such aserror
,warn
,info
,debug
,trace
. However, if theconsole
object it inherits from is frozen, as it is in the ses-shim of HardenedJS, then this assignment fails due to the so-called "override mistake".Changing this assignment to use
Object.defineProperty
instead avoids hitting the override mistake. The additional attributes I include in this changeare only there to preserve equivalence with assignment. But feel free to change them to whatever you'd like. Such changes would not affect the purpose of this PR.