From dcc3e98937d8ec5c10f69438888b4cd99c15e5bf Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 2 Oct 2018 14:00:29 -0400 Subject: [PATCH] refactor: remove replaceChild from nodeOps --- packages/renderer-dom/src/nodeOps.ts | 4 ---- packages/renderer-test/src/nodeOps.ts | 10 ---------- 2 files changed, 14 deletions(-) diff --git a/packages/renderer-dom/src/nodeOps.ts b/packages/renderer-dom/src/nodeOps.ts index df17fcd3..0d6a358f 100644 --- a/packages/renderer-dom/src/nodeOps.ts +++ b/packages/renderer-dom/src/nodeOps.ts @@ -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) }, diff --git a/packages/renderer-test/src/nodeOps.ts b/packages/renderer-test/src/nodeOps.ts index f36eadea..c9bf0dd6 100644 --- a/packages/renderer-test/src/nodeOps.ts +++ b/packages/renderer-test/src/nodeOps.ts @@ -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,