Store scanning information whether JSXText is just an all whitespaces

This commit is contained in:
Kanchalai Tanglertsampan
2017-04-11 14:55:26 -07:00
parent 17417e9a88
commit 4562fd089c
4 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -1729,7 +1729,6 @@ namespace ts {
// firstNonWhitespace = 0 to indicate that we want leading whitspace,
while (pos < end) {
pos++;
char = text.charCodeAt(pos);
if (char === CharacterCodes.openBrace) {
break;
@@ -1754,6 +1753,7 @@ namespace ts {
else if (!isWhiteSpaceSingleLine(char)) {
firstNonWhitespace = pos;
}
pos++;
}
return firstNonWhitespace === -1 ? SyntaxKind.JsxTextAllWhiteSpaces : SyntaxKind.JsxText;