Index: src/parsing/parser.h |
diff --git a/src/parsing/parser.h b/src/parsing/parser.h |
index 62bd066cd4e2660d96a919c94133f9b97a0a2c4e..94496eb1e4d8b964962722f24d747745d9e69274 100644 |
--- a/src/parsing/parser.h |
+++ b/src/parsing/parser.h |
@@ -335,6 +335,9 @@ class ParserTraits { |
typedef v8::internal::AstProperties AstProperties; |
+ typedef v8::internal::ExpressionClassifier<ParserTraits> |
+ ExpressionClassifier; |
+ |
// Return types for traversing functions. |
typedef const AstRawString* Identifier; |
typedef v8::internal::Expression* Expression; |
@@ -549,7 +552,7 @@ class ParserTraits { |
int initializer_end_position, bool is_rest); |
V8_INLINE void DeclareFormalParameter( |
Scope* scope, const ParserFormalParameters::Parameter& parameter, |
- ExpressionClassifier* classifier); |
+ Type::ExpressionClassifier* classifier); |
void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters, |
Expression* params, |
const Scanner::Location& params_loc, |
@@ -643,6 +646,7 @@ class ParserTraits { |
V8_INLINE void QueueDestructuringAssignmentForRewriting( |
Expression* assignment); |
+ V8_INLINE void QueueNonPatternForRewriting(Expression* expr); |
void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
const AstRawString* name); |
@@ -651,11 +655,12 @@ class ParserTraits { |
Expression* identifier); |
// Rewrite expressions that are not used as patterns |
- V8_INLINE Expression* RewriteNonPattern( |
- Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
- V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
- ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
- bool* ok); |
+ V8_INLINE void RewriteNonPattern(Type::ExpressionClassifier* classifier, |
+ bool* ok); |
+ |
+ V8_INLINE Zone* zone() const; |
+ |
+ V8_INLINE ZoneList<Expression*>* GetNonPatternList() const; |
Expression* RewriteYieldStar( |
Expression* generator, Expression* expression, int pos); |
@@ -812,8 +817,9 @@ class Parser : public ParserBase<ParserTraits> { |
const DeclarationParsingResult::Declaration* declaration, |
ZoneList<const AstRawString*>* names, bool* ok); |
- static void RewriteDestructuringAssignment( |
- Parser* parser, RewritableAssignmentExpression* expr, Scope* Scope); |
+ static void RewriteDestructuringAssignment(Parser* parser, |
+ RewritableExpression* expr, |
+ Scope* Scope); |
static Expression* RewriteDestructuringAssignment(Parser* parser, |
Assignment* assignment, |
@@ -1029,11 +1035,7 @@ class Parser : public ParserBase<ParserTraits> { |
friend class NonPatternRewriter; |
V8_INLINE Expression* RewriteSpreads(ArrayLiteral* lit); |
- V8_INLINE Expression* RewriteNonPattern( |
- Expression* expr, const ExpressionClassifier* classifier, bool* ok); |
- V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty( |
- ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
- bool* ok); |
+ V8_INLINE void RewriteNonPattern(ExpressionClassifier* classifier, bool* ok); |
friend class InitializerRewriter; |
void RewriteParameterInitializer(Expression* expr, Scope* scope); |
@@ -1184,7 +1186,7 @@ void ParserTraits::AddFormalParameter(ParserFormalParameters* parameters, |
void ParserTraits::DeclareFormalParameter( |
Scope* scope, const ParserFormalParameters::Parameter& parameter, |
- ExpressionClassifier* classifier) { |
+ Type::ExpressionClassifier* classifier) { |
bool is_duplicate = false; |
bool is_simple = classifier->is_simple_parameter_list(); |
auto name = is_simple || parameter.is_rest |