refactor: remove replaceChild from nodeOps
This commit is contained in:
parent
adfe0ee7bf
commit
dcc3e98937
@ -18,10 +18,6 @@ export const nodeOps = {
|
|||||||
parent.insertBefore(child, ref)
|
parent.insertBefore(child, ref)
|
||||||
},
|
},
|
||||||
|
|
||||||
replaceChild: (parent: Node, oldChild: Node, newChild: Node) => {
|
|
||||||
parent.replaceChild(newChild, oldChild)
|
|
||||||
},
|
|
||||||
|
|
||||||
removeChild: (parent: Node, child: Node) => {
|
removeChild: (parent: Node, child: Node) => {
|
||||||
parent.removeChild(child)
|
parent.removeChild(child)
|
||||||
},
|
},
|
||||||
|
@ -137,15 +137,6 @@ function insertBefore(parent: TestElement, child: TestNode, ref: TestNode) {
|
|||||||
child.parentNode = parent
|
child.parentNode = parent
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceChild(
|
|
||||||
parent: TestElement,
|
|
||||||
oldChild: TestNode,
|
|
||||||
newChild: TestNode
|
|
||||||
) {
|
|
||||||
insertBefore(parent, newChild, oldChild)
|
|
||||||
removeChild(parent, oldChild)
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeChild(parent: TestElement, child: TestNode) {
|
function removeChild(parent: TestElement, child: TestNode) {
|
||||||
logNodeOp({
|
logNodeOp({
|
||||||
type: NodeOpTypes.REMOVE,
|
type: NodeOpTypes.REMOVE,
|
||||||
@ -201,7 +192,6 @@ export const nodeOps = {
|
|||||||
setText,
|
setText,
|
||||||
appendChild,
|
appendChild,
|
||||||
insertBefore,
|
insertBefore,
|
||||||
replaceChild,
|
|
||||||
removeChild,
|
removeChild,
|
||||||
clearContent,
|
clearContent,
|
||||||
parentNode,
|
parentNode,
|
||||||
|
Loading…
Reference in New Issue
Block a user