-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Revert "src: don't overwrite non-writable vm globals" #10920
Conversation
This reverts commit 524f693. Fixes: nodejs#10806 Fixes: nodejs#10492 Ref: nodejs#10227
Add the regression test script presented in nodejs#10806 to `test/parallel` and re-add the original regression test for nodejs#10223 in `test/known_issues`.
SmartOS failure in CI sure seems like unrelated build flakiness but out of a super-abundance of caution, here's a re-run on SmartOS only: https://ci.nodejs.org/job/node-test-commit-smartos/6494/ |
|
||
const ctx = vm.createContext(); | ||
vm.runInContext('Object.defineProperty(this, "x", { value: 42 })', ctx); | ||
assert.strictEqual(ctx.x, undefined); // Not copied out by cloneProperty(). |
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.
For future reference: it's not IMO the expected or desired behavior, just the actual behavior.
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.
@bnoordhuis Right, I agree. Would you prefer it if I updated the test with strictEqual(ctx.x, 42)
here?
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.
No need, it was more of an off-the-cuff remark.
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 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
return; | ||
ctx->global_proxy()->HasRealNamedProperty(ctx->context(), | ||
property).FromJust(); | ||
bool is_contextual_store = ctx->global_proxy() != args.This(); |
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.
We came to the conclusion that is_contextual_store is always true and shouldn't be here in the first place. Do you want to remove it from the revert or should I make an extra PR. Extra PR probably keeps history and bisects cleaner.
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.
Yeah, an extra PR sounds better – mostly because
a) this PR can be landed now (if anybody reading this has a few minutes left over, please feel free to take that task) and
b) because my understanding of this code is actually kind of limited ;)
Add the regression test script presented in #10806 to `test/parallel` and re-add the original regression test for #10223 in `test/known_issues`. PR-URL: #10920 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Add the regression test script presented in #10806 to `test/parallel` and re-add the original regression test for #10223 in `test/known_issues`. PR-URL: #10920 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This reverts commit 524f693. Fixes: nodejs#10806 Fixes: nodejs#10492 Ref: nodejs#10227 PR-URL: nodejs#10920 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Add the regression test script presented in nodejs#10806 to `test/parallel` and re-add the original regression test for nodejs#10223 in `test/known_issues`. PR-URL: nodejs#10920 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This reverts commit 524f693. Fixes: nodejs#10806 Fixes: nodejs#10492 Ref: nodejs#10227 PR-URL: nodejs#10920 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Add the regression test script presented in nodejs#10806 to `test/parallel` and re-add the original regression test for nodejs#10223 in `test/known_issues`. PR-URL: nodejs#10920 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
/cc @bnoordhuis @fhinkel
CI: https://ci.nodejs.org/job/node-test-commit/7383/