fix https://github.com/sveltejs/svelte/issues/2086: detach error when node is not attached to DOM

pull/3156/head
Brian Takita 6 years ago
parent 9883a50bf9
commit d57eadd52b

@ -7,8 +7,10 @@ export function insert(target: Node, node: Node, anchor?: Node) {
}
export function detach(node: Node) {
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
export function detach_between(before: Node, after: Node) {
while (before.nextSibling && before.nextSibling !== after) {

Loading…
Cancel
Save