Skip to content

Commit 642ea15

Browse files
lessfishkiku-jw
authored andcommitted
refactor: remove useless parameter to the function removeVnodes (vuejs#9914)
close vuejs#9910
1 parent fe7a740 commit 642ea15

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: packages/weex-vue-framework/factory.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5797,7 +5797,7 @@ function createPatchFunction (backend) {
57975797
}
57985798
}
57995799

5800-
function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
5800+
function removeVnodes (vnodes, startIdx, endIdx) {
58015801
for (; startIdx <= endIdx; ++startIdx) {
58025802
var ch = vnodes[startIdx];
58035803
if (isDef(ch)) {
@@ -5908,7 +5908,7 @@ function createPatchFunction (backend) {
59085908
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
59095909
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
59105910
} else if (newStartIdx > newEndIdx) {
5911-
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
5911+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
59125912
}
59135913
}
59145914

@@ -5985,7 +5985,7 @@ function createPatchFunction (backend) {
59855985
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
59865986
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
59875987
} else if (isDef(oldCh)) {
5988-
removeVnodes(elm, oldCh, 0, oldCh.length - 1);
5988+
removeVnodes(oldCh, 0, oldCh.length - 1);
59895989
} else if (isDef(oldVnode.text)) {
59905990
nodeOps.setTextContent(elm, '');
59915991
}
@@ -6216,7 +6216,7 @@ function createPatchFunction (backend) {
62166216

62176217
// destroy old node
62186218
if (isDef(parentElm$1)) {
6219-
removeVnodes(parentElm$1, [oldVnode], 0, 0);
6219+
removeVnodes([oldVnode], 0, 0);
62206220
} else if (isDef(oldVnode.tag)) {
62216221
invokeDestroyHook(oldVnode);
62226222
}

Diff for: src/core/vdom/patch.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export function createPatchFunction (backend) {
358358
}
359359
}
360360

361-
function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
361+
function removeVnodes (vnodes, startIdx, endIdx) {
362362
for (; startIdx <= endIdx; ++startIdx) {
363363
const ch = vnodes[startIdx]
364364
if (isDef(ch)) {
@@ -469,7 +469,7 @@ export function createPatchFunction (backend) {
469469
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm
470470
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue)
471471
} else if (newStartIdx > newEndIdx) {
472-
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx)
472+
removeVnodes(oldCh, oldStartIdx, oldEndIdx)
473473
}
474474
}
475475

@@ -561,7 +561,7 @@ export function createPatchFunction (backend) {
561561
if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, '')
562562
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue)
563563
} else if (isDef(oldCh)) {
564-
removeVnodes(elm, oldCh, 0, oldCh.length - 1)
564+
removeVnodes(oldCh, 0, oldCh.length - 1)
565565
} else if (isDef(oldVnode.text)) {
566566
nodeOps.setTextContent(elm, '')
567567
}
@@ -790,7 +790,7 @@ export function createPatchFunction (backend) {
790790

791791
// destroy old node
792792
if (isDef(parentElm)) {
793-
removeVnodes(parentElm, [oldVnode], 0, 0)
793+
removeVnodes([oldVnode], 0, 0)
794794
} else if (isDef(oldVnode.tag)) {
795795
invokeDestroyHook(oldVnode)
796796
}

0 commit comments

Comments
 (0)