Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 90dd6a7c43ab728613008dd4c9af5014aad2c69b..f04b1459cc63a2a812c2539225176fa9a1c70815 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -4444,15 +4444,15 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> function_name, |
Variable* fvar = NULL; |
Token::Value fvar_init_op = Token::INIT_CONST; |
if (type == FunctionLiteral::NAMED_EXPRESSION) { |
- VariableMode fvar_mode; |
- if (is_extended_mode()) { |
- fvar_mode = CONST_HARMONY; |
- fvar_init_op = Token::INIT_CONST_HARMONY; |
- } else { |
- fvar_mode = CONST; |
- } |
- fvar = |
- top_scope_->DeclareFunctionVar(function_name, fvar_mode, factory()); |
+ if (is_extended_mode()) fvar_init_op = Token::INIT_CONST_HARMONY; |
+ VariableMode fvar_mode = is_extended_mode() ? CONST_HARMONY : CONST; |
+ fvar = new(zone()) Variable(top_scope_, |
+ function_name, fvar_mode, true /* is valid LHS */, |
+ Variable::NORMAL, kCreatedInitialized); |
+ VariableProxy* proxy = factory()->NewVariableProxy(fvar); |
+ VariableDeclaration* fvar_declaration = |
+ factory()->NewVariableDeclaration(proxy, fvar_mode, top_scope_); |
+ top_scope_->DeclareFunctionVar(fvar_declaration); |
} |
// Determine whether the function will be lazily compiled. |