Refactor Angular ngNonBindable child replacement (#20141)
This commit is contained in:
1 parent
124438262b
commit
2a1fcd2999
1 file changed
+7
-6
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user