Skip to content

Commit 9761072

Browse files
committed
refactor: rename variable
1 parent 9734e87 commit 9761072

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/vdom/patch.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export function createPatchFunction (backend) {
369369
let newEndIdx = newCh.length - 1
370370
let newStartVnode = newCh[0]
371371
let newEndVnode = newCh[newEndIdx]
372-
let oldKeyToIdx, idxInOld, elmToMove, refElm
372+
let oldKeyToIdx, idxInOld, vnodeToMove, refElm
373373

374374
// removeOnly is a special flag used only by <transition-group>
375375
// to ensure removed elements stay in correct relative positions
@@ -407,18 +407,18 @@ export function createPatchFunction (backend) {
407407
if (isUndef(idxInOld)) { // New element
408408
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
409409
} else {
410-
elmToMove = oldCh[idxInOld]
410+
vnodeToMove = oldCh[idxInOld]
411411
/* istanbul ignore if */
412-
if (process.env.NODE_ENV !== 'production' && !elmToMove) {
412+
if (process.env.NODE_ENV !== 'production' && !vnodeToMove) {
413413
warn(
414414
'It seems there are duplicate keys that is causing an update error. ' +
415415
'Make sure each v-for item has a unique key.'
416416
)
417417
}
418-
if (sameVnode(elmToMove, newStartVnode)) {
419-
patchVnode(elmToMove, newStartVnode, insertedVnodeQueue)
418+
if (sameVnode(vnodeToMove, newStartVnode)) {
419+
patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue)
420420
oldCh[idxInOld] = undefined
421-
canMove && nodeOps.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm)
421+
canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm)
422422
} else {
423423
// same key but different element. treat as new element
424424
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)

0 commit comments

Comments
 (0)