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

Unified Diff: src/ast/scopes.cc

Issue 2574753002: Disable lazy parsing inside eval (see bug). (Closed)
Patch Set: code review (adamk@) 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 | test/mjsunit/bugs/bug-2728.js » ('j') | 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 0258ff023a1abe9f9579ab13e12b10a940b97379..4c18ab6c5dae35f31e186aba0dcaa917af79c2f2 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1179,10 +1179,7 @@ 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_) {
- // Eval forces context allocation on all outer scopes, so we don't need to
- // look at those scopes. Sloppy eval makes all top-level variables dynamic,
- // whereas strict-mode requires context allocation.
- if (s->is_eval_scope()) return !is_strict(s->language_mode());
+ 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 | test/mjsunit/bugs/bug-2728.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698