]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: remove replaceChild from nodeOps
authorEvan You <yyx990803@gmail.com>
Tue, 2 Oct 2018 18:00:29 +0000 (14:00 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 2 Oct 2018 18:00:29 +0000 (14:00 -0400)
packages/renderer-dom/src/nodeOps.ts
packages/renderer-test/src/nodeOps.ts

index df17fcd3eba281a272e287ab517f40498b33b5eb..0d6a358fc2eff1959dec472147c2deb952924457 100644 (file)
@@ -18,10 +18,6 @@ export const nodeOps = {
     parent.insertBefore(child, ref)
   },
 
-  replaceChild: (parent: Node, oldChild: Node, newChild: Node) => {
-    parent.replaceChild(newChild, oldChild)
-  },
-
   removeChild: (parent: Node, child: Node) => {
     parent.removeChild(child)
   },
index f36eadea7a943370ed81abbcfc8b6ac3f3e3c75d..c9bf0dd67c5a61697d55583603d3f3104c4ed86c 100644 (file)
@@ -137,15 +137,6 @@ function insertBefore(parent: TestElement, child: TestNode, ref: TestNode) {
   child.parentNode = parent
 }
 
-function replaceChild(
-  parent: TestElement,
-  oldChild: TestNode,
-  newChild: TestNode
-) {
-  insertBefore(parent, newChild, oldChild)
-  removeChild(parent, oldChild)
-}
-
 function removeChild(parent: TestElement, child: TestNode) {
   logNodeOp({
     type: NodeOpTypes.REMOVE,
@@ -201,7 +192,6 @@ export const nodeOps = {
   setText,
   appendChild,
   insertBefore,
-  replaceChild,
   removeChild,
   clearContent,
   parentNode,