Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4167,7 +4167,7 @@ namespace ts {
// We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword
// We only want to consider "this" as a primaryExpression
let expression: JsxTagNameExpression = token() === SyntaxKind.ThisKeyword ?
parseTokenNode<PrimaryExpression>() : parseIdentifierName();
parseTokenNode<ThisExpression>() : parseIdentifierName();
while (parseOptional(SyntaxKind.DotToken)) {
const propertyAccess: PropertyAccessExpression = <PropertyAccessExpression>createNode(SyntaxKind.PropertyAccessExpression, expression.pos);
propertyAccess.expression = expression;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ namespace ts {

export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;

export type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
export type JsxTagNameExpression = Identifier | ThisExpression | PropertyAccessExpression;

export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
parent?: JsxOpeningLikeElement;
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ declare namespace ts {
}
type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
type JsxTagNameExpression = Identifier | ThisExpression | PropertyAccessExpression;
interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
parent?: JsxOpeningLikeElement;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ declare namespace ts {
}
type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
type JsxTagNameExpression = Identifier | ThisExpression | PropertyAccessExpression;
interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
parent?: JsxOpeningLikeElement;
}
Expand Down