Skip to content

vm: mark global proxy as side-effect-free - #27523

Closed
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:vm-no-sideeffects
Closed

vm: mark global proxy as side-effect-free#27523
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:vm-no-sideeffects

Conversation

@addaleax

Copy link
Copy Markdown
Member

Fixes: #27518

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-botnodejs-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 May 1, 2019
@addaleaxaddaleax changed the title vm: mark global Proxy as side-effect-freevm: mark global proxy as side-effect-freeMay 1, 2019
@addaleax
addaleaxforce-pushed the vm-no-sideeffects branch from b508b4e to 178dbb8CompareMay 1, 2019 21:23
@nodejs-github-bot

This comment has been minimized.

@alexkozyalexkozy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As long as calling to this NamedPropertyHandler is unobservable from JavaScript world - looks good to me!

@addaleax

Copy link
Copy Markdown
MemberAuthor

@ak239 It doesn’t – it might call into JS, however. Your comment gave me the idea to add a test for when that JS code has a side effect – thanks!

@alexkozy

Copy link
Copy Markdown
Member

Nice test! As implementer of this side effect free eval in JS - any other calls to JS world should be fine, since they will contain the same side effects check, so getter without side effects should work, even getter that creates temporary objects and modify them will work.

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 3, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in 815b3aa

@addaleax
addaleax deleted the vm-no-sideeffects branch May 13, 2019 23:55
addaleax added a commit that referenced this pull request May 13, 2019
Fixes: #27518
PR-URL: #27523
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit to addaleax/node that referenced this pull request May 14, 2019
Read-only access to `process.env` does not have side effects.
Refs: nodejs#27523
targos pushed a commit that referenced this pull request May 14, 2019
Fixes: #27518
PR-URL: #27523
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
pullBot pushed a commit to Rachelmorrell/node that referenced this pull request May 18, 2019
Read-only access to `process.env` does not have side effects.
Refs: nodejs#27523
PR-URL: nodejs#27684
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
targos pushed a commit that referenced this pull request May 18, 2019
Read-only access to `process.env` does not have side effects.
Refs: #27523
PR-URL: #27684
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@BridgeARBridgeAR mentioned this pull request May 21, 2019
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.vmIssues and PRs related to the vm subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inspector: Runtime.evaluate with throwOnSideEffect & contextId of vm.createContext throws when it shouldn't

9 participants

@addaleax@nodejs-github-bot@alexkozy@bnoordhuis@jasnell@targos@cjihrig@devsnek@BridgeAR