Skip to content

Commit 3267c76

Browse files
authored
Fix debug assert for type assertions / JSX (#52919)
1 parent 6bbdcaa commit 3267c76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6167,7 +6167,7 @@ namespace Parser {
61676167
}
61686168

61696169
function parseTypeAssertion(): TypeAssertion {
6170-
Debug.assert(scriptKind === ScriptKind.TS, "Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.");
6170+
Debug.assert(languageVariant !== LanguageVariant.JSX, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");
61716171
const pos = getNodePos();
61726172
parseExpected(SyntaxKind.LessThanToken);
61736173
const type = parseType();

0 commit comments

Comments
 (0)