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

Unified Diff: src/parsing/parser-base.h

Issue 1632303002: Treat yield expressions as an AssignmentPattern error (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added test Created 4 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
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index d03815c44d99e14f4b0e70ac171ec0663f11bfd8..bd9ef707b6c694b15c6561dcb63b91554e7822e7 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2108,7 +2108,8 @@ ParserBase<Traits>::ParseYieldExpression(ExpressionClassifier* classifier,
// YieldExpression ::
// 'yield' ([no line terminator] '*'? AssignmentExpression)?
int pos = peek_position();
- BindingPatternUnexpectedToken(classifier);
+ classifier->RecordPatternError(scanner()->peek_location(),
+ MessageTemplate::kInvalidDestructuringTarget);
FormalParameterInitializerUnexpectedToken(classifier);
Expect(Token::YIELD, CHECK_OK);
ExpressionT generator_object =
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698