()
| 4966 | } |
| 4967 | |
| 4968 | func (p *Parser) parseJsxElementName() *ast.Expression { |
| 4969 | pos := p.nodePos() |
| 4970 | // JsxElement can have name in the form of |
| 4971 | // propertyAccessExpression |
| 4972 | // primaryExpression in the form of an identifier and "this" keyword |
| 4973 | // We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword |
| 4974 | // We only want to consider "this" as a primaryExpression |
| 4975 | initialExpression := p.parseJsxTagName() |
| 4976 | if ast.IsJsxNamespacedName(initialExpression) { |
| 4977 | return initialExpression // `a:b.c` is invalid syntax, don't even look for the `.` if we parse `a:b`, and let `parseAttribute` report "unexpected :" instead. |
| 4978 | } |
| 4979 | expression := initialExpression |
| 4980 | for p.parseOptional(ast.KindDotToken) { |
| 4981 | expression = p.finishNode(p.factory.NewPropertyAccessExpression(expression, nil, p.parseRightSideOfDot(true /*allowIdentifierNames*/, false /*allowPrivateIdentifiers*/, false /*allowUnicodeEscapeSequenceInIdentifierName*/), ast.NodeFlagsNone), pos) |
| 4982 | } |
| 4983 | return expression |
| 4984 | } |
| 4985 | |
| 4986 | func (p *Parser) parseJsxTagName() *ast.Expression { |
| 4987 | pos := p.nodePos() |
no test coverage detected