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

Unified Diff: src/ast/scopes.h

Issue 2083083007: Fix bug with re-scoping arrow function parameter initializers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/parsing/parameter-initializer-rewriter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 088710b8dde0eec7ae821f5d707c9689c6724099..95f2c4a893c5c50b7da98d50321c1e9109c4ff33 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -216,7 +216,11 @@ class Scope: public ZoneObject {
// Adds a temporary variable in this scope's TemporaryScope. This is for
// adjusting the scope of temporaries used when desugaring parameter
// initializers.
- void AddTemporary(Variable* var) { temps_.Add(var, zone()); }
+ void AddTemporary(Variable* var) {
+ // Temporaries are only placed in ClosureScopes.
+ DCHECK_EQ(ClosureScope(), this);
+ temps_.Add(var, zone());
+ }
// Adds the specific declaration node to the list of declarations in
// this scope. The declarations are processed as part of entering
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/parsing/parameter-initializer-rewriter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698