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

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: Optimization for closure scopes 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') | no next file with comments »
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 cb1fb5bdac5659f2aa71ffd4bb074e227e3546fa..e420cfe053ab4eb616020747c54d23f592715424 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698