-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: fix vm module for strict mode #16487
Conversation
This fixes the issue, but it's not pretty. Not sure if we want to fix the issue like this or completely rethink our strategy for throwing in the sandboxed environment. |
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. Doesn't seem too terrible to me although there might be a bit of a performance hit (two lookups instead of sometimes one, sometimes two - although I expect the latter is the more common path.)
src/node_contextify.cc
Outdated
@@ -346,14 +346,21 @@ class ContextifyContext { | |||
return; | |||
|
|||
auto attributes = PropertyAttribute::None; | |||
bool is_declared = ctx->global_proxy() | |||
bool is_declared_global_proxy = ctx->global_proxy() |
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.
is_declared_on_global_proxy
?
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. Fixes: nodejs#12300
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.
(somewhat rubber-stampy lgtm)
Thanks for the reviews. Landed in 5856c83 |
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: #16487 Fixes: #12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: #16487 Fixes: #12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: #16487 Fixes: #12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: #16487 Fixes: #12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: nodejs/node#16487 Fixes: nodejs/node#12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: nodejs/node#16487 Fixes: nodejs/node#12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Should this be backported to |
This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: nodejs/node#16487 Fixes: nodejs/node#12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch fixes the problem with variables that
are declared only on the sandbox but not on the
global proxy.
Fixes: #12300
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
src