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

Unified Diff: src/preparser.cc

Issue 1060883004: [strong] Implement static restrictions on binding 'undefined' in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: linebreak Created 5 years, 8 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
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index d4515fcb51d9b8c555daf52457a4a63c209ec747..a02305ffd206bb0a0b5097e9961685cd52c7d5b2 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -916,12 +916,12 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
// We don't yet know if the function will be strict, so we cannot yet produce
// errors for parameter names or duplicates. However, we remember the
// locations of these errors if they occur and produce the errors later.
- Scanner::Location eval_args_error_loc = Scanner::Location::invalid();
- Scanner::Location dupe_error_loc = Scanner::Location::invalid();
- Scanner::Location reserved_error_loc = Scanner::Location::invalid();
+ Scanner::Location eval_args_loc = Scanner::Location::invalid();
+ Scanner::Location dupe_loc = Scanner::Location::invalid();
+ Scanner::Location reserved_loc = Scanner::Location::invalid();
// Similarly for strong mode.
- Scanner::Location undefined_error_loc = Scanner::Location::invalid();
+ Scanner::Location undefined_loc = Scanner::Location::invalid();
bool is_rest = false;
bool done = arity_restriction == FunctionLiteral::GETTER_ARITY ||
@@ -936,20 +936,20 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
Identifier param_name =
ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK);
- if (!eval_args_error_loc.IsValid() && param_name.IsEvalOrArguments()) {
- eval_args_error_loc = scanner()->location();
+ if (!eval_args_loc.IsValid() && param_name.IsEvalOrArguments()) {
+ eval_args_loc = scanner()->location();
}
- if (!undefined_error_loc.IsValid() && param_name.IsUndefined()) {
- undefined_error_loc = scanner()->location();
+ if (!undefined_loc.IsValid() && param_name.IsUndefined()) {
+ undefined_loc = scanner()->location();
}
- if (!reserved_error_loc.IsValid() && is_strict_reserved) {
- reserved_error_loc = scanner()->location();
+ if (!reserved_loc.IsValid() && is_strict_reserved) {
+ reserved_loc = scanner()->location();
}
int prev_value = scanner()->FindSymbol(&duplicate_finder, 1);
- if (!dupe_error_loc.IsValid() && prev_value != 0) {
- dupe_error_loc = scanner()->location();
+ if (!dupe_loc.IsValid() && prev_value != 0) {
+ dupe_loc = scanner()->location();
}
if (arity_restriction == FunctionLiteral::SETTER_ARITY) break;
@@ -984,9 +984,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
CheckFunctionName(language_mode(), kind, function_name,
name_is_strict_reserved, function_name_location, CHECK_OK);
const bool use_strict_params = is_rest || IsConciseMethod(kind);
- CheckFunctionParameterNames(language_mode(), use_strict_params,
- eval_args_error_loc, undefined_error_loc,
- dupe_error_loc, reserved_error_loc, CHECK_OK);
+ CheckFunctionParameterNames(language_mode(), use_strict_params, eval_args_loc,
+ undefined_loc, dupe_loc, reserved_loc, CHECK_OK);
if (is_strict(language_mode())) {
int end_position = scanner()->location().end_pos;
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698