Index: src/ast/scopes.h |
diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
index 96fcc5141be46124a8478b2e56723f516e9fd1ca..6b58bdf9ee565427da0cbe8dd5318bd63bae0df9 100644 |
--- a/src/ast/scopes.h |
+++ b/src/ast/scopes.h |
@@ -202,7 +202,9 @@ class Scope: public ZoneObject { |
// eval call. |
void RecordEvalCall() { |
scope_calls_eval_ = true; |
- for (Scope* scope = this; scope != nullptr; scope = scope->outer_scope()) { |
+ inner_scope_calls_eval_ = true; |
+ for (Scope* scope = outer_scope(); scope && !scope->is_script_scope(); |
+ scope = scope->outer_scope()) { |
scope->inner_scope_calls_eval_ = true; |
} |
} |