Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 5cc2dc2ae8eb515c281066a8a8943785068dbaab..864b10d376e7e9fd06e082f929fd5e9f56560b2c 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -137,6 +137,10 @@ PreParser::PreParseResult PreParser::PreParseFunction( |
LazyParsingResult result = ParseStatementListAndLogFunction( |
&formals, has_duplicate_parameters, may_abort, ok); |
+ if (is_sloppy(function_scope->language_mode())) { |
+ function_scope->HoistSloppyBlockFunctions(nullptr); |
+ } |
+ |
if (!IsArrowFunction(kind) && track_unresolved_variables_) { |
// Declare arguments after parsing the function since lexical 'arguments' |
// masks the arguments object. Declare arguments before declaring the |
@@ -144,10 +148,6 @@ PreParser::PreParseResult PreParser::PreParseFunction( |
function_scope->DeclareArguments(ast_value_factory()); |
} |
- if (is_sloppy(function_scope->language_mode())) { |
- function_scope->HoistSloppyBlockFunctions(nullptr); |
- } |
- |
use_counts_ = nullptr; |
track_unresolved_variables_ = false; |