From e9a2355e80363f1f69368b18f8cf12d056c28dfd Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 19 Jan 2022 13:14:45 -0800 Subject: [PATCH] More PR feedback --- src/services/utilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index abd7fcca5f9..58cbbfa7c70 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1344,8 +1344,8 @@ namespace ts { const child = children[i]; if (isWhiteSpaceOnlyJsxText(child)) { - if (parentKind === SyntaxKind.JsxText || parentKind === SyntaxKind.JsxSelfClosingElement) { - 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`"); } } else if (nodeHasTokens(children[i], sourceFile)) {