Skip to content

Commit e9a2355

Browse files
committed
More PR feedback
1 parent 9570a59 commit e9a2355

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/utilities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1344,8 +1344,8 @@ namespace ts {
13441344
const child = children[i];
13451345

13461346
if (isWhiteSpaceOnlyJsxText(child)) {
1347-
if (parentKind === SyntaxKind.JsxText || parentKind === SyntaxKind.JsxSelfClosingElement) {
1348-
Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
1347+
if (i === 0 && (parentKind === SyntaxKind.JsxText || parentKind === SyntaxKind.JsxSelfClosingElement)) {
1348+
Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
13491349
}
13501350
}
13511351
else if (nodeHasTokens(children[i], sourceFile)) {

0 commit comments

Comments
 (0)