Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Issue 2353623002: Filter out synthetic variables from with scopes (Closed)

Created:
4 years, 3 months ago by Dan Ehrenberg
Modified:
4 years, 3 months ago
Reviewers:
adamk, Toon Verwaest
CC:
neis, v8-reviews_googlegroups.com, Toon Verwaest
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Filter out synthetic variables from with scopes This patch ensures that variables like .new_target aren't overwritable using with scopes. It does this by ensuring that scope analysis does not consider with scopes (or eval scopes) for such 'synthetic variables', similarly to how the 'this' variable was already handled. The patch also adds a DCHECK for the dynamic parallel to this case, replacing a previous unreachable path for a particular instance. BUG=v8:5405 Committed: https://crrev.com/dcd61b90207adc8cc068c2b86c9f5a9d4e54999f Cr-Commit-Position: refs/heads/master@{#39567}

Patch Set 1 #

Patch Set 2 : formatting #

Patch Set 3 : Test against the raw_name, not the name #

Patch Set 4 : Fix whitespace #

Total comments: 4

Patch Set 5 : Minimal fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -5 lines) Patch
M src/contexts.cc View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M test/mjsunit/regress/regress-5405.js View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 32 (22 generated)
Dan Ehrenberg
4 years, 3 months ago (2016-09-19 19:57:37 UTC) #14
adamk
https://codereview.chromium.org/2353623002/diff/60001/src/ast/scopeinfo.cc File src/ast/scopeinfo.cc (right): https://codereview.chromium.org/2353623002/diff/60001/src/ast/scopeinfo.cc#newcode621 src/ast/scopeinfo.cc:621: bool Scope::VariableIsSynthetic(const AstRawString* name) { Yikes, I think this ...
4 years, 3 months ago (2016-09-19 20:01:26 UTC) #17
Toon Verwaest
https://codereview.chromium.org/2353623002/diff/60001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2353623002/diff/60001/src/ast/scopes.cc#newcode1451 src/ast/scopes.cc:1451: if (Scope::VariableIsSynthetic(var->raw_name())) return var; I'd be much in favor ...
4 years, 3 months ago (2016-09-19 20:01:50 UTC) #19
Dan Ehrenberg
https://codereview.chromium.org/2353623002/diff/60001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2353623002/diff/60001/src/ast/scopes.cc#newcode1451 src/ast/scopes.cc:1451: if (Scope::VariableIsSynthetic(var->raw_name())) return var; On 2016/09/19 at 20:01:50, Toon ...
4 years, 3 months ago (2016-09-20 17:22:13 UTC) #20
Dan Ehrenberg
What do you think of this minimal fix for new.target while a better solution is ...
4 years, 3 months ago (2016-09-20 21:40:48 UTC) #21
adamk
FWIW this minimal fix lgtm; Toon, thoughts?
4 years, 3 months ago (2016-09-20 22:02:52 UTC) #24
Toon Verwaest
Lgtm thanks. Surprised to see this handled there as it should never happen.
4 years, 3 months ago (2016-09-20 22:08:31 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2353623002/80001
4 years, 3 months ago (2016-09-20 22:11:44 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-09-20 22:14:04 UTC) #30
commit-bot: I haz the power
4 years, 3 months ago (2016-09-20 22:15:10 UTC) #32
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/dcd61b90207adc8cc068c2b86c9f5a9d4e54999f
Cr-Commit-Position: refs/heads/master@{#39567}

Powered by Google App Engine
This is Rietveld 408576698