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

Unified Diff: src/parsing/preparser.cc

Issue 2579303002: Preparsing inner funcs: declare arguments for preparsed scopes (Closed)
Patch Set: added this Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index d765876a88072b680c29af0050752a4292bb851d..cc7f9f52bdf4dc73528ff0683fca60d74cec8f3f 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -131,11 +131,19 @@ PreParser::PreParseResult PreParser::PreParseFunction(
formals_end_position, CHECK_OK_VALUE(kPreParseSuccess));
has_duplicate_parameters =
!classifier()->is_valid_formal_parameter_list_without_duplicates();
+
+ if (track_unresolved_variables_) {
+ function_scope->DeclareVariableName(
+ ast_value_factory()->arguments_string(), VAR);
+ function_scope->DeclareVariableName(ast_value_factory()->this_string(),
+ VAR);
+ }
}
Expect(Token::LBRACE, CHECK_OK_VALUE(kPreParseSuccess));
LazyParsingResult result = ParseStatementListAndLogFunction(
&formals, has_duplicate_parameters, may_abort, ok);
+
use_counts_ = nullptr;
track_unresolved_variables_ = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698