From 2a1fcd2999b4ecd5b0d853144c951d50936f7cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Wed, 23 Sep 2026 13:07:56 +0300 Subject: [PATCH] Refactor Angular `ngNonBindable` child replacement (#20141) --- src/language-html/print-preprocess.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/language-html/print-preprocess.js b/src/language-html/print-preprocess.js index 61b3ad0fd..f7710a2ea 100644 --- a/src/language-html/print-preprocess.js +++ b/src/language-html/print-preprocess.js @@ -149,17 +149,18 @@ function convertAngularNonBindableChildren(node, options) { replacements.push(createOriginalTextNode(sourceSpan, options)); } - children.splice( - i, - 1, - ...replacements.map((replacement) => node.createChild(replacement)), - ); + for (const replacement of replacements) { + node.insertChildBefore(child, replacement); + } + node.removeChild(child); + i += replacements.length - 1; continue; } if (child.kind === "angularLetDeclaration") { - children[i] = node.createChild( + node.replaceChild( + child, createOriginalTextNode(child.sourceSpan, options), ); continue;