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

Unified Diff: src/parsing/expression-classifier.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: Rebased 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 | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/expression-classifier.h
diff --git a/src/parsing/expression-classifier.h b/src/parsing/expression-classifier.h
index 4f76492b7e5aaf8776da9211eb5be47656cebebb..7603cb54eb1cb521cfbf9012f6793bb9d83c9aaf 100644
--- a/src/parsing/expression-classifier.h
+++ b/src/parsing/expression-classifier.h
@@ -12,20 +12,18 @@
namespace v8 {
namespace internal {
-
-#define ERROR_CODES(T) \
- T(ExpressionProduction, 0) \
- T(FormalParameterInitializerProduction, 1) \
- T(BindingPatternProduction, 2) \
- T(AssignmentPatternProduction, 3) \
- T(DistinctFormalParametersProduction, 4) \
- T(StrictModeFormalParametersProduction, 5) \
- T(ArrowFormalParametersProduction, 6) \
- T(LetPatternProduction, 7) \
- T(ObjectLiteralProduction, 8) \
- T(TailCallExpressionProduction, 9) \
- T(AsyncArrowFormalParametersProduction, 10) \
- T(AsyncBindingPatternProduction, 11)
+#define ERROR_CODES(T) \
+ T(ExpressionProduction, 0) \
+ T(FormalParameterInitializerProduction, 1) \
+ T(BindingPatternProduction, 2) \
+ T(AssignmentPatternProduction, 3) \
+ T(DistinctFormalParametersProduction, 4) \
+ T(StrictModeFormalParametersProduction, 5) \
+ T(ArrowFormalParametersProduction, 6) \
+ T(LetPatternProduction, 7) \
+ T(ObjectLiteralProduction, 8) \
+ T(TailCallExpressionProduction, 9) \
+ T(AsyncArrowFormalParametersProduction, 10)
template <typename Traits>
class ExpressionClassifier {
@@ -62,12 +60,11 @@ class ExpressionClassifier {
ERROR_CODES(DEFINE_PRODUCTION)
#undef DEFINE_PRODUCTION
- ExpressionProductions =
- (ExpressionProduction | FormalParameterInitializerProduction |
- TailCallExpressionProduction),
- PatternProductions =
- (BindingPatternProduction | AssignmentPatternProduction |
- LetPatternProduction | AsyncBindingPatternProduction),
+ ExpressionProductions =
+ (ExpressionProduction | FormalParameterInitializerProduction |
+ TailCallExpressionProduction),
+ PatternProductions = (BindingPatternProduction |
+ AssignmentPatternProduction | LetPatternProduction),
FormalParametersProductions = (DistinctFormalParametersProduction |
StrictModeFormalParametersProduction),
AllProductions =
@@ -150,10 +147,6 @@ class ExpressionClassifier {
return is_valid(AsyncArrowFormalParametersProduction);
}
- bool is_valid_async_binding_pattern() const {
- return is_valid(AsyncBindingPatternProduction);
- }
-
V8_INLINE const Error& expression_error() const {
return reported_error(kExpressionProduction);
}
@@ -205,10 +198,6 @@ class ExpressionClassifier {
return reported_error(kAsyncArrowFormalParametersProduction);
}
- V8_INLINE const Error& async_binding_pattern_error() const {
- return reported_error(kAsyncBindingPatternProduction);
- }
-
V8_INLINE bool is_simple_parameter_list() const {
return !(function_properties_ & NonSimpleParameter);
}
@@ -280,14 +269,6 @@ class ExpressionClassifier {
Add(Error(loc, message, kAsyncArrowFormalParametersProduction, arg));
}
- void RecordAsyncBindingPatternError(const Scanner::Location& loc,
- MessageTemplate::Template message,
- const char* arg = nullptr) {
- if (!is_valid_async_binding_pattern()) return;
- invalid_productions_ |= AsyncBindingPatternProduction;
- Add(Error(loc, message, kAsyncBindingPatternProduction, arg));
- }
-
void RecordDuplicateFormalParameterError(const Scanner::Location& loc) {
if (!is_valid_formal_parameter_list_without_duplicates()) return;
invalid_productions_ |= DistinctFormalParametersProduction;
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698