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

Unified Diff: src/parsing/preparser.cc

Issue 2670633003: [parser] Skipping inner funcs: produce the same scopes / variables for sloppy block funcs. (Closed)
Patch Set: code review (vogelheim@) Created 3 years, 11 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
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;
« src/ast/scopes.cc ('K') | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698