-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: remove unused env->vm_parsing_context_symbol #22034
Conversation
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.
This is still very much used in https://github.com/nodejs/node/blob/master/lib/vm.js. The way the symbol was used in that file made the tests magically pass (as the string key 'undefined'
is used in place).
In that particular file the symbol could just be changed to a regular local one declared with Symbol()
.
@TimothyGu But is the property read anywhere? At a glance, it looks like this would be safe to remove from |
Ah, sorry, missed the I agree with @addaleax though that the use in |
+1 for removal and using a |
@TimothyGu I updated to use a symbol declared inside |
Looks good, thanks! |
4641899
to
677cd3b
Compare
Landed in bd2ee60, thank you for the reviews! |
Stopped being used via 77b52fd, was originally added in d932e80. For the one remaining usecase inside of `lib/vm.js`, define a Symbol at the top of the file. PR-URL: #22034 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@maclover7 @TimothyGu Uh … this seems to have gotten lost in the discussion, but still, does anything speak against removing this key completely? |
@addaleax The symbol is used to transmit the parsing context information from |
Stopped being used via 77b52fd, was originally added in d932e80. For the one remaining usecase inside of `lib/vm.js`, define a Symbol at the top of the file. PR-URL: #22034 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Stopped being used via 77b52fd, was
originally added in d932e80.
For the one remaining usecase inside of
lib/vm.js
, define a Symbol atthe top of the file.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes