You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function getLiteralTypeFromProperty(prop: Symbol, include: TypeFlags, includeNonPublic?: boolean) {
17018
17031
if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & ModifierFlags.NonPublicAccessibilityModifier)) {
17019
17032
let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;
17020
17033
if (!type) {
17021
-
const name = getNameOfDeclaration(prop.valueDeclaration) as PropertyName;
17034
+
const name = getNameOfDeclaration(prop.valueDeclaration) as PropertyName | JsxAttributeName;
17022
17035
type = prop.escapedName === InternalSymbolName.Default ? getStringLiteralType("default") :
17023
17036
name && getLiteralTypeFromPropertyName(name) || (!isKnownSymbol(prop) ? getStringLiteralType(symbolName(prop)) : undefined);
17024
17037
}
@@ -32621,7 +32634,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
32621
32634
if (getJsxNamespaceContainerForImplicitImport(node)) {
32622
32635
return true; // factory is implicitly jsx/jsxdev - assume it fits the bill, since we don't strongly look for the jsx/jsxs/jsxDEV factory APIs anywhere else (at least not yet)
Copy file name to clipboardExpand all lines: src/compiler/parser.ts
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,7 @@ import {
147
147
isJSDocNullableType,
148
148
isJSDocReturnTag,
149
149
isJSDocTypeTag,
150
+
isJsxNamespacedName,
150
151
isJsxOpeningElement,
151
152
isJsxOpeningFragment,
152
153
isKeyword,
@@ -228,7 +229,6 @@ import {
228
229
JsxSelfClosingElement,
229
230
JsxSpreadAttribute,
230
231
JsxTagNameExpression,
231
-
JsxTagNamePropertyAccess,
232
232
JsxText,
233
233
JsxTokenSyntaxKind,
234
234
LabeledStatement,
@@ -6112,11 +6112,15 @@ namespace Parser {
6112
6112
// primaryExpression in the form of an identifier and "this" keyword
6113
6113
// We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword
6114
6114
// We only want to consider "this" as a primaryExpression
6115
-
let expression: JsxTagNameExpression = parseJsxTagName();
6115
+
const initialExpression = parseJsxTagName();
6116
+
if (isJsxNamespacedName(initialExpression)) {
6117
+
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.
6118
+
}
6119
+
let expression: PropertyAccessExpression | Identifier | ThisExpression = initialExpression;
6116
6120
while (parseOptional(SyntaxKind.DotToken)) {
6117
-
expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false)), pos) as JsxTagNamePropertyAccess;
/** @internal */readonlytextSourceNode?: Identifier|StringLiteralLike|NumericLiteral|PrivateIdentifier;// Allows a StringLiteral to get its text from another node (used by transforms).
2333
+
/** @internal */readonlytextSourceNode?: Identifier|StringLiteralLike|NumericLiteral|PrivateIdentifier|JsxNamespacedName;// Allows a StringLiteral to get its text from another node (used by transforms).
2336
2334
/**
2337
2335
* Note: this is only set when synthesizing a node, not during parsing.
0 commit comments