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

Unified Diff: src/parser.cc

Issue 1274193004: Let eval scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix another test Created 5 years, 4 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 | test/mjsunit/harmony/block-conflicts-sloppy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 45202cb3a82b922c7d487061cfff03578cc3a3c9..52936198f0f37647596db79f52c3b94b8074b0af 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2019,7 +2019,8 @@ Variable* Parser::Declare(Declaration* declaration,
declaration_scope->is_strict_eval_scope() ||
adamk 2015/08/11 01:17:43 I think it would be clearer to get rid of this lin
Dan Ehrenberg 2015/08/11 20:57:02 Done
declaration_scope->is_block_scope() ||
declaration_scope->is_module_scope() ||
- declaration_scope->is_script_scope()) {
+ declaration_scope->is_script_scope() ||
+ (declaration_scope->is_eval_scope() && IsLexicalVariableMode(mode))) {
adamk 2015/08/11 01:17:43 ...and replace this condition with: (declaration_
Dan Ehrenberg 2015/08/11 20:57:02 Done
// Declare the variable in the declaration scope.
var = declaration_scope->LookupLocal(name);
if (var == NULL) {
@@ -2099,7 +2100,8 @@ Variable* Parser::Declare(Declaration* declaration,
var = new (zone()) Variable(declaration_scope, name, mode, kind,
kNeedsInitialization, kNotAssigned);
} else if (declaration_scope->is_eval_scope() &&
- is_sloppy(declaration_scope->language_mode())) {
+ is_sloppy(declaration_scope->language_mode()) &&
+ !IsLexicalVariableMode(mode)) {
adamk 2015/08/11 01:17:43 It's weird that this isn't part of an else/if clau
Dan Ehrenberg 2015/08/11 20:57:02 Good point; moved it to an else clause above. The
// For variable declarations in a sloppy eval scope the proxy is bound
// to a lookup variable to force a dynamic declaration using the
// DeclareLookupSlot runtime function.
« no previous file with comments | « no previous file | test/mjsunit/harmony/block-conflicts-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698