Cleaned up some stray-code

This commit is contained in:
Miel Truyen 2019-11-03 15:36:54 +01:00
parent 3a135a30d1
commit 5ca9bec93a

View File

@ -157,7 +157,6 @@ export function render(vnode, opts = {}) {
}
let sortedChildTypes = Array.from(childTypes).sort((a,b)=>a==='node'?1:-1); // Always do ChildNode-types last
let queuedItems = [];
let previous = null;
@ -209,30 +208,10 @@ export function render(vnode, opts = {}) {
// Subsequent child
previous.host.after(item.host);
}
//item.parent.appendChild(item.host);
}
}
if(!item.parent) newRoot = item.host;
}
// //if(item.host instanceof Element || item.host instanceof Text){// Not good enough, both Element and Text inherit from Node, which would make more sense, but ShadowRoot also inherits from node, and unlike the others it shouldnt be appended as a child-element
// if(item.host instanceof ShadowRoot){
// console.log("I expected a crash here...", item);
// }
// if(item.host instanceof Node){
// let parent = item.parent;
// if(parent){
// //parent.insertBefore(nextChildNode, childNodes[i])// When its not the last el...
// parent.appendChild(item.host);
// }else{
// newRoot = item.host;// This could be implemented as refs...
// }
// }
// if(item.host instanceof ShadowRoot){
// //console.log("Does this work then?..", item);
// // item.parent.removeChild(item.host);// No it does not!
// }
}
return newRoot;
}