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

Unified Diff: src/preparser.cc

Issue 1429983002: [es6] early error when Identifier is an escaped reserved word (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Bunch of comments addressed + mozilla/test262 statuses updated Created 5 years, 1 month 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/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 74e11b1d454b3b33a3f6bcadb18f91476a246f37..57c051f9ce89a518ae2ba08b5b67ff05903648c2 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -155,6 +155,13 @@ PreParserExpression PreParserTraits::ParseClassLiteral(
}
+#define CHECK_OK ok); \
+ if (!*ok) return Statement::Default(); \
+ ((void)0
+#define DUMMY ) // to make indentation work
+#undef DUMMY
+
+
// Preparsing checks a JavaScript program and emits preparse-data that helps
// a later parsing to be faster.
// See preparser-data.h for the data.
@@ -202,6 +209,9 @@ PreParser::Statement PreParser::ParseStatementListItem(bool* ok) {
return ParseVariableStatement(kStatementListItem, ok);
}
break;
+ case Token::IDENTIFIER:
+ CheckNextEscapedKeyword(CHECK_OK);
+ break;
default:
break;
}
@@ -304,13 +314,6 @@ void PreParser::ParseStatementList(int end_token, bool* ok,
}
-#define CHECK_OK ok); \
- if (!*ok) return Statement::Default(); \
- ((void)0
-#define DUMMY ) // to make indentation work
-#undef DUMMY
-
-
PreParser::Statement PreParser::ParseStatement(bool* ok) {
// Statement ::
// EmptyStatement

Powered by Google App Engine
This is Rietveld 408576698