Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

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`.
@addaleax addaleax added dont-land-on-v4.x vm Issues and PRs related to the vm subsystem. labels Jan 20, 2017
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. vm Issues and PRs related to the vm subsystem. labels Jan 20, 2017
@Trott
Copy link
Member

Trott commented Jan 20, 2017

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().
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-/ LGTM

Copy link
Member

@fhinkel fhinkel left a 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();
Copy link
Member

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.

Copy link
Member Author

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 ;)

@jasnell
Copy link
Member

jasnell commented Jan 24, 2017

@addaleax
Copy link
Member Author

Landed in 3e851cf, 1ef38e9

@addaleax addaleax closed this Jan 25, 2017
@addaleax addaleax deleted the revert-vm-globals branch January 25, 2017 23:48
addaleax added a commit that referenced this pull request Jan 25, 2017
This reverts commit 524f693.

Fixes: #10806
Fixes: #10492
Ref: #10227
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>
addaleax added a commit that referenced this pull request Jan 25, 2017
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>
targos pushed a commit that referenced this pull request Jan 28, 2017
This reverts commit 524f693.

Fixes: #10806
Fixes: #10492
Ref: #10227
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>
targos pushed a commit that referenced this pull request Jan 28, 2017
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>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants