no need to use is_array, it is always an array when hydrating

pull/10896/head
Rich Harris 2 years ago
parent 3199f50e4b
commit 45cc648155

@ -179,9 +179,11 @@ export function comment(anchor) {
function close_template(dom, is_fragment, anchor) { function close_template(dom, is_fragment, anchor) {
/** @type {import('#client').Dom} */ /** @type {import('#client').Dom} */
var current = is_fragment var current = is_fragment
? is_array(dom) ? hydrating
? dom ? // if hydrating, `dom` is already an array of nodes
: /** @type {import('#client').TemplateNode[]} */ (Array.from(dom.childNodes)) dom
: // otherwise we need to create an array to store it on the current effect
/** @type {import('#client').TemplateNode[]} */ (Array.from(dom.childNodes))
: dom; : dom;
if (!hydrating && anchor !== null) { if (!hydrating && anchor !== null) {

Loading…
Cancel
Save