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. |