refactor: rename variable

This commit is contained in:
Nolan Lawson 2023-12-11 19:17:16 -08:00
parent baa696b07b
commit 9df6a5802d
1 changed files with 5 additions and 5 deletions

View File

@ -196,7 +196,7 @@ function parse (tokens) {
}
}
function findBindingIdsToPlaceholderComments (element) {
function findPlaceholderComments (element) {
const result = new Map()
for (const childNode of element.childNodes) {
// Note that minify-html-literals has already removed all non-framework comments
@ -218,7 +218,7 @@ function traverseAndSetupBindings (dom, elementsToBindings) {
do {
const bindings = elementsToBindings.get(++elementIndex)
if (bindings) {
let bindingIdsToPlaceholderComments
let placeholderComments
for (let i = 0; i < bindings.length; i++) {
const binding = bindings[i]
@ -226,10 +226,10 @@ function traverseAndSetupBindings (dom, elementsToBindings) {
if (binding.attributeName) { // attribute binding
targetNode = element
} else { // not an attribute binding, so has a placeholder comment
if (!bindingIdsToPlaceholderComments) { // find all placeholder comments once
bindingIdsToPlaceholderComments = findBindingIdsToPlaceholderComments(element)
if (!placeholderComments) { // find all placeholder comments once
placeholderComments = findPlaceholderComments(element)
}
targetNode = bindingIdsToPlaceholderComments.get(i)
targetNode = placeholderComments.get(i)
if (process.env.NODE_ENV !== 'production' && !targetNode) {
throw new Error('targetNode should not be undefined')
}