-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Avoid property override hazard #70
Comments
FUDCo
added a commit
to Agoric/agoric-sdk
that referenced
this issue
Oct 13, 2022
Lockdown breaks Ava under certain versions of NodeJS. It turns out to be due to a bug in the `stack-utils` npm package with trips over the override mistake. I've filed an issue with the maintainer of that package, but in the meantime this patch deals with the problem. See tapjs/stack-utils#70
FUDCo
added a commit
to Agoric/agoric-sdk
that referenced
this issue
Oct 13, 2022
Lockdown breaks Ava under certain versions of NodeJS. It turns out to be due to a bug in the `stack-utils` npm package with trips over the override mistake. I've filed an issue with the maintainer of that package, but in the meantime this patch deals with the problem. See tapjs/stack-utils#70
erights
added a commit
to erights/stack-utils
that referenced
this issue
Oct 13, 2022
JavaScript has a misfeature often called the "override mistake". In an assignment such as ```js res.constructor = true; ``` if `res` does not yet have its own `constructor` property, but inherits one that this assignment would override (as is the intention here), but the property that would be overridden is a non-writable data property, then the assignment fails. Hardened JS and similar frameworks for securing JS routinely freeze all the primordial objects, which causes their data properties to become non-configurable, non-writable. Also, the TC53 JS standard for embedded devices standardizes on Hardened JS, which will also cause this problem. The XS JS engine for embedded devices use the Hardened JS configuration by default on embedded devices. Object literals and classes override inherited properties without problem because they use JS's "define" semantics rather than JS's peculiar "assign" semantics. You can also do so manually via `Object.defineProperty`, as this PR does to repair this issue. See also tapjs#70 Agoric/agoric-sdk#6451
PR now at #71 |
turadg
pushed a commit
to Agoric/agoric-sdk
that referenced
this issue
Oct 18, 2022
Lockdown breaks Ava under certain versions of NodeJS. It turns out to be due to a bug in the `stack-utils` npm package with trips over the override mistake. I've filed an issue with the maintainer of that package, but in the meantime this patch deals with the problem. See tapjs/stack-utils#70
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
stack-utils@2.0.5
for the project I'm working on.Assignments to
res.constructor
trip over the JavaScript property override mistake, causing Ava test assertion failure results in some environments to become unable to be output. The problem can be reproduced if you freezeObject.prototype
.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: