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 |