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

Unified Diff: src/ast/scopes.h

Issue 2312903003: Don't record that eval calls in inner scopes in script scopes (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | 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 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;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698