Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 36268493e971ae185e2f88b5254cc5a88a7dde70..34a1ef224ab8a93291ce35952a6adb0316d4067c 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -1480,6 +1480,10 @@ Statement* Parser::DeclareFunction(const AstRawString* variable_name, |
bool* ok) { |
VariableProxy* proxy = |
factory()->NewVariableProxy(variable_name, NORMAL_VARIABLE); |
+ |
+ DeclarationScope* target_scope = GetDeclarationScope(); |
+ MarkTopLevelVariableAsAssigned(target_scope, proxy); |
+ |
Declaration* declaration = |
factory()->NewFunctionDeclaration(proxy, function, scope(), pos); |
Declare(declaration, DeclarationDescriptor::NORMAL, mode, kCreatedInitialized, |
@@ -1488,7 +1492,6 @@ Statement* Parser::DeclareFunction(const AstRawString* variable_name, |
if (is_sloppy_block_function) { |
SloppyBlockFunctionStatement* statement = |
factory()->NewSloppyBlockFunctionStatement(); |
- DeclarationScope* target_scope = GetDeclarationScope(); |
target_scope->DeclareSloppyBlockFunction(variable_name, scope(), statement); |
return statement; |
} |