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

Unified Diff: src/parsing/preparser.cc

Issue 2267493002: Disallow 'await' in object literal shorthand position (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More cleanup Created 4 years, 4 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 d90d943d9fb70ac6b1b7377590ca68388ee3a50e..77a39dc70dba1a5f0721fe3d9ec9ec79826e1e65 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -403,13 +403,6 @@ PreParser::Statement PreParser::ParseHoistableDeclaration(
Identifier name = ParseIdentifierOrStrictReservedWord(
&is_strict_reserved, CHECK_OK);
- if (V8_UNLIKELY(is_async_function() && this->IsAwait(name))) {
- ReportMessageAt(scanner()->location(),
- MessageTemplate::kAwaitBindingIdentifier);
- *ok = false;
- return Statement::Default();
- }
-
ParseFunctionLiteral(name, scanner()->location(),
is_strict_reserved ? kFunctionNameIsStrictReserved
: kFunctionNameValidityUnknown,
@@ -1162,13 +1155,8 @@ PreParser::Expression PreParser::ParseAsyncFunctionExpression(bool* ok) {
if (peek_any_identifier()) {
type = FunctionLiteral::kNamedExpression;
- name = ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK);
- if (this->IsAwait(name)) {
- ReportMessageAt(scanner()->location(),
- MessageTemplate::kAwaitBindingIdentifier);
- *ok = false;
- return Expression::Default();
- }
+ name = ParseIdentifierOrStrictReservedWord(FunctionKind::kAsyncFunction,
+ &is_strict_reserved, CHECK_OK);
}
ParseFunctionLiteral(name, scanner()->location(),
« src/parsing/parser-base.h ('K') | « src/parsing/preparser.h ('k') | src/parsing/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698