| Index: src/parsing/parser.h
|
| diff --git a/src/parsing/parser.h b/src/parsing/parser.h
|
| index 87b6a910a458bb231687a0a4fb268d0194f99865..965283b1a9b113b6fcf20056c8828ca007131183 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;
|
| @@ -547,7 +550,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,
|
| @@ -642,6 +645,7 @@ class ParserTraits {
|
|
|
| V8_INLINE void QueueDestructuringAssignmentForRewriting(
|
| Expression* assignment);
|
| + V8_INLINE void QueueNonPatternForRewriting(Expression* expr);
|
|
|
| void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property,
|
| const AstRawString* name);
|
| @@ -650,11 +654,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);
|
| @@ -807,8 +812,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,
|
| @@ -1025,11 +1031,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);
|
| @@ -1180,7 +1182,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
|
|
|