| Index: src/preparser.h
|
| diff --git a/src/preparser.h b/src/preparser.h
|
| index a17296349b362df6afefbb5b8538d7c030915270..6e2a9de575bf3d8c4b086a82829e3fb094733495 100644
|
| --- a/src/preparser.h
|
| +++ b/src/preparser.h
|
| @@ -2653,23 +2653,6 @@ ParserBase<Traits>::ParseLeftHandSideExpression(bool* ok) {
|
| break;
|
| }
|
|
|
| - case Token::TEMPLATE_SPAN:
|
| - case Token::TEMPLATE_TAIL: {
|
| - int pos;
|
| - if (scanner()->current_token() == Token::IDENTIFIER) {
|
| - pos = position();
|
| - } else {
|
| - pos = peek_position();
|
| - if (result->IsFunctionLiteral() && mode() == PARSE_EAGERLY) {
|
| - // If the tag function looks like an IIFE, set_parenthesized() to
|
| - // force eager compilation.
|
| - result->AsFunctionLiteral()->set_parenthesized();
|
| - }
|
| - }
|
| - result = ParseTemplateLiteral(result, pos, CHECK_OK);
|
| - break;
|
| - }
|
| -
|
| case Token::PERIOD: {
|
| Consume(Token::PERIOD);
|
| int pos = position();
|
| @@ -2740,7 +2723,7 @@ typename ParserBase<Traits>::ExpressionT
|
| ParserBase<Traits>::ParseMemberExpression(bool* ok) {
|
| // MemberExpression ::
|
| // (PrimaryExpression | FunctionLiteral | ClassLiteral)
|
| - // ('[' Expression ']' | '.' Identifier | Arguments)*
|
| + // ('[' Expression ']' | '.' Identifier | Arguments | TemplateLiteral)*
|
|
|
| // The '[' Expression ']' and '.' Identifier parts are parsed by
|
| // ParseMemberExpressionContinuation, and the Arguments part is parsed by the
|
| @@ -2817,7 +2800,7 @@ typename ParserBase<Traits>::ExpressionT
|
| ParserBase<Traits>::ParseMemberExpressionContinuation(ExpressionT expression,
|
| bool* ok) {
|
| // Parses this part of MemberExpression:
|
| - // ('[' Expression ']' | '.' Identifier)*
|
| + // ('[' Expression ']' | '.' Identifier | TemplateLiteral)*
|
| while (true) {
|
| switch (peek()) {
|
| case Token::LBRACK: {
|
| @@ -2842,6 +2825,22 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(ExpressionT expression,
|
| }
|
| break;
|
| }
|
| + case Token::TEMPLATE_SPAN:
|
| + case Token::TEMPLATE_TAIL: {
|
| + int pos;
|
| + if (scanner()->current_token() == Token::IDENTIFIER) {
|
| + pos = position();
|
| + } else {
|
| + pos = peek_position();
|
| + if (expression->IsFunctionLiteral() && mode() == PARSE_EAGERLY) {
|
| + // If the tag function looks like an IIFE, set_parenthesized() to
|
| + // force eager compilation.
|
| + expression->AsFunctionLiteral()->set_parenthesized();
|
| + }
|
| + }
|
| + expression = ParseTemplateLiteral(expression, pos, CHECK_OK);
|
| + break;
|
| + }
|
| default:
|
| return expression;
|
| }
|
|
|