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

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

Issue 2258313002: [async functions] Disallow 'await' in arrow params inside async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/parsing/expression-classifier.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/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 0a2bf4e45a045c2146c90f6ebcf90cdfa58070f8..c5b1d28fa9743d734c219a6f13101c4b9d6d2bdf 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -933,16 +933,8 @@ class ParserBase : public Traits {
void ValidateBindingPattern(const ExpressionClassifier* classifier,
bool* ok) {
- if (!classifier->is_valid_binding_pattern() ||
caitp 2016/08/19 23:04:34 If this passes tests, it looks great. At some poin
adamk 2016/08/19 23:07:42 Yeah, that was exactly my thinking (and it seems t
- !classifier->is_valid_async_binding_pattern()) {
- const Scanner::Location& a = classifier->binding_pattern_error().location;
- const Scanner::Location& b =
- classifier->async_binding_pattern_error().location;
- if (a.beg_pos < 0 || (b.beg_pos >= 0 && a.beg_pos > b.beg_pos)) {
- ReportClassifierError(classifier->async_binding_pattern_error());
- } else {
- ReportClassifierError(classifier->binding_pattern_error());
- }
+ if (!classifier->is_valid_binding_pattern()) {
+ ReportClassifierError(classifier->binding_pattern_error());
*ok = false;
}
}
@@ -2788,12 +2780,10 @@ ParserBase<Traits>::ParseUnaryExpression(ExpressionClassifier* classifier,
Next();
IdentifierT name = this->GetSymbol(scanner());
- // Possibly async arrow formals --- record ExpressionError just in case.
- ExpressionUnexpectedToken(classifier);
- classifier->RecordAsyncBindingPatternError(
+ classifier->RecordBindingPatternError(
Scanner::Location(beg_pos, scanner()->location().end_pos),
MessageTemplate::kAwaitBindingIdentifier);
- classifier->RecordAsyncArrowFormalParametersError(
+ classifier->RecordArrowFormalParametersError(
caitp 2016/08/19 23:04:34 good find!
Scanner::Location(beg_pos, scanner()->location().end_pos),
MessageTemplate::kAwaitBindingIdentifier);
« no previous file with comments | « src/parsing/expression-classifier.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698