From 43b98fe25151b0b6bacd36f3ee27c5d61add5fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E8=BF=9F?= Date: Thu, 25 Apr 2019 10:34:55 +0800 Subject: [PATCH] refactor: remove useless parameter to the function removeVnodes (#9914) close #9910 --- packages/weex-vue-framework/factory.js | 8 ++++---- src/core/vdom/patch.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/weex-vue-framework/factory.js b/packages/weex-vue-framework/factory.js index 8bcfb675b..fb30d12bb 100644 --- a/packages/weex-vue-framework/factory.js +++ b/packages/weex-vue-framework/factory.js @@ -5797,7 +5797,7 @@ function createPatchFunction (backend) { } } - function removeVnodes (parentElm, vnodes, startIdx, endIdx) { + function removeVnodes (vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { var ch = vnodes[startIdx]; if (isDef(ch)) { @@ -5908,7 +5908,7 @@ function createPatchFunction (backend) { refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); } else if (newStartIdx > newEndIdx) { - removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + removeVnodes(oldCh, oldStartIdx, oldEndIdx); } } @@ -5985,7 +5985,7 @@ function createPatchFunction (backend) { if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); } else if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1); + removeVnodes(oldCh, 0, oldCh.length - 1); } else if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } @@ -6216,7 +6216,7 @@ function createPatchFunction (backend) { // destroy old node if (isDef(parentElm$1)) { - removeVnodes(parentElm$1, [oldVnode], 0, 0); + removeVnodes([oldVnode], 0, 0); } else if (isDef(oldVnode.tag)) { invokeDestroyHook(oldVnode); } diff --git a/src/core/vdom/patch.js b/src/core/vdom/patch.js index 9746bb794..2052df913 100644 --- a/src/core/vdom/patch.js +++ b/src/core/vdom/patch.js @@ -358,7 +358,7 @@ export function createPatchFunction (backend) { } } - function removeVnodes (parentElm, vnodes, startIdx, endIdx) { + function removeVnodes (vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { const ch = vnodes[startIdx] if (isDef(ch)) { @@ -469,7 +469,7 @@ export function createPatchFunction (backend) { refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue) } else if (newStartIdx > newEndIdx) { - removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx) + removeVnodes(oldCh, oldStartIdx, oldEndIdx) } } @@ -561,7 +561,7 @@ export function createPatchFunction (backend) { if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, '') addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue) } else if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1) + removeVnodes(oldCh, 0, oldCh.length - 1) } else if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, '') } @@ -790,7 +790,7 @@ export function createPatchFunction (backend) { // destroy old node if (isDef(parentElm)) { - removeVnodes(parentElm, [oldVnode], 0, 0) + removeVnodes([oldVnode], 0, 0) } else if (isDef(oldVnode.tag)) { invokeDestroyHook(oldVnode) }