We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9570a59 commit e9a2355Copy full SHA for e9a2355
src/services/utilities.ts
@@ -1344,8 +1344,8 @@ namespace ts {
1344
const child = children[i];
1345
1346
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`");
+ if (i === 0 && (parentKind === SyntaxKind.JsxText || parentKind === SyntaxKind.JsxSelfClosingElement)) {
+ Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
1349
}
1350
1351
else if (nodeHasTokens(children[i], sourceFile)) {
0 commit comments