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

Unified Diff: src/ast/scopes.cc

Issue 2583163002: Force ctxt allocation in eval scopes. (Closed)
Patch Set: Created 4 years 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.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 6b6532149f05df1a5be973299ce35234a02c715e..216daa27d23d423ddcc1afa47ab9fc0b1b5c10bb 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -124,7 +124,8 @@ Scope::Scope(Zone* zone, Scope* outer_scope, ScopeType scope_type)
SetDefaults();
set_language_mode(outer_scope->language_mode());
force_context_allocation_ =
- !is_function_scope() && outer_scope->has_forced_context_allocation();
+ (!is_function_scope() && outer_scope->has_forced_context_allocation()) ||
+ is_eval_scope();
adamk 2017/01/03 18:33:43 I don't think you want to do this here; "forced co
marja 2017/01/03 19:55:50 Done.
outer_scope_->AddInnerScope(this);
}
@@ -1179,7 +1180,6 @@ bool Scope::AllowsLazyParsingWithoutUnresolvedVariables(
// the parse, since context allocation of those variables is already
// guaranteed to be correct.
for (const Scope* s = this; s != outer; s = s->outer_scope_) {
- if (s->is_eval_scope()) return false;
// Catch scopes force context allocation of all variables.
if (s->is_catch_scope()) continue;
// With scopes do not introduce variables that need allocation.
« 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