(pos int, expression *ast.Expression, questionDotToken *ast.Node)
| 5439 | } |
| 5440 | |
| 5441 | func (p *Parser) parseElementAccessExpressionRest(pos int, expression *ast.Expression, questionDotToken *ast.Node) *ast.Node { |
| 5442 | var argumentExpression *ast.Expression |
| 5443 | if p.token == ast.KindCloseBracketToken { |
| 5444 | p.parseErrorAt(p.nodePos(), p.nodePos(), diagnostics.An_element_access_expression_should_take_an_argument) |
| 5445 | argumentExpression = p.createMissingIdentifier() |
| 5446 | } else { |
| 5447 | argument := p.parseExpressionAllowIn() |
| 5448 | switch argument.Kind { |
| 5449 | case ast.KindStringLiteral: |
| 5450 | argument.AsStringLiteral().Text = p.internIdentifier(argument.Text()) |
| 5451 | case ast.KindNoSubstitutionTemplateLiteral: |
| 5452 | argument.AsNoSubstitutionTemplateLiteral().Text = p.internIdentifier(argument.Text()) |
| 5453 | case ast.KindNumericLiteral: |
| 5454 | argument.AsNumericLiteral().Text = p.internIdentifier(argument.Text()) |
| 5455 | } |
| 5456 | argumentExpression = argument |
| 5457 | } |
| 5458 | p.parseExpected(ast.KindCloseBracketToken) |
| 5459 | isOptionalChain := questionDotToken != nil || p.tryReparseOptionalChain(expression) |
| 5460 | return p.finishNode(p.factory.NewElementAccessExpression(expression, questionDotToken, argumentExpression, core.IfElse(isOptionalChain, ast.NodeFlagsOptionalChain, ast.NodeFlagsNone)), pos) |
| 5461 | } |
| 5462 | |
| 5463 | func (p *Parser) parseCallExpressionRest(pos int, expression *ast.Expression) *ast.Expression { |
| 5464 | for { |
no test coverage detected