Allow /* comments between < and JSX element name

This commit is contained in:
Ryan Cavanaugh
2015-09-28 16:11:10 -07:00
parent c55d6dc0e3
commit f780d68499
6 changed files with 60 additions and 1 deletions

View File

@@ -3183,6 +3183,7 @@ namespace ts {
if (sourceFile.languageVariant !== LanguageVariant.JSX) {
return parseTypeAssertion();
}
debugger;
if (lookAhead(nextTokenIsIdentifierOrKeyword)) {
return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true);
}

View File

@@ -1361,7 +1361,9 @@ namespace ts {
if (text.charCodeAt(pos + 1) === CharacterCodes.equals) {
return pos += 2, token = SyntaxKind.LessThanEqualsToken;
}
if (text.charCodeAt(pos + 1) === CharacterCodes.slash && languageVariant === LanguageVariant.JSX) {
if (text.charCodeAt(pos + 1) === CharacterCodes.slash &&
text.charCodeAt(pos + 2) !== CharacterCodes.asterisk &&
languageVariant === LanguageVariant.JSX) {
return pos += 2, token = SyntaxKind.LessThanSlashToken;
}
return pos++, token = SyntaxKind.LessThanToken;