Skip to content

Commit

Permalink
feedback: change Array.from(children) -> querySelectorAll
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeiZ committed Mar 4, 2023
1 parent b5a3537 commit 1e5e9af
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (document.body != null) {
}

function handleExistingNodes(target /*: HTMLElement */) {
const existingNodes = Array.from(target.children);
const existingNodes = target.querySelectorAll('template');
for (let i = 0; i < existingNodes.length; i++) {
handleNode(existingNodes[i]);
}
Expand All @@ -62,8 +62,8 @@ function installFizzInstrObserver(target /*: Node */) {
for (let i = 0; i < mutations.length; i++) {
const addedNodes = mutations[i].addedNodes;
for (let j = 0; j < addedNodes.length; j++) {
if (addedNodes.item(j).parentNode) {
handleNode(addedNodes.item(j));
if (addedNodes[j].parentNode) {
handleNode(addedNodes[j]);
}
}
}
Expand Down

0 comments on commit 1e5e9af

Please sign in to comment.