remove unused destroyEach and destroy arguments

pull/863/head
Rich Harris 7 years ago
parent 64026c3ba9
commit c8f094cf80

@ -122,7 +122,7 @@ export default function visitEachBlock(
); );
block.builders.destroy.addBlock(deindent` block.builders.destroy.addBlock(deindent`
if (${each_block_else}) ${each_block_else}.destroy(false); if (${each_block_else}) ${each_block_else}.destroy();
`); `);
} }
@ -351,7 +351,7 @@ function keyed(
block.builders.destroy.addBlock(deindent` block.builders.destroy.addBlock(deindent`
var ${iteration} = ${head}; var ${iteration} = ${head};
while (${iteration}) { while (${iteration}) {
${iteration}.destroy(false); ${iteration}.destroy();
${iteration} = ${iteration}.next; ${iteration} = ${iteration}.next;
} }
`); `);
@ -486,5 +486,5 @@ function unkeyed(
} }
`); `);
block.builders.destroy.addBlock(`@destroyEach(${iterations}, false, 0);`); block.builders.destroy.addBlock(`@destroyEach(${iterations});`);
} }

@ -47,10 +47,9 @@ export function reinsertBefore(after, target) {
while (parent.firstChild !== after) target.appendChild(parent.firstChild); while (parent.firstChild !== after) target.appendChild(parent.firstChild);
} }
// TODO this is out of date export function destroyEach(iterations) {
export function destroyEach(iterations, detach, start) { for (var i = 0; i < iterations.length; i += 1) {
for (var i = start; i < iterations.length; i += 1) { if (iterations[i]) iterations[i].destroy();
if (iterations[i]) iterations[i].destroy(detach);
} }
} }

@ -31,10 +31,9 @@ function detachAfter(before) {
} }
} }
// TODO this is out of date function destroyEach(iterations) {
function destroyEach(iterations, detach, start) { for (var i = 0; i < iterations.length; i += 1) {
for (var i = start; i < iterations.length; i += 1) { if (iterations[i]) iterations[i].destroy();
if (iterations[i]) iterations[i].destroy(detach);
} }
} }
@ -268,7 +267,7 @@ function create_main_fragment(state, component) {
}, },
destroy: function() { destroy: function() {
destroyEach(each_blocks, false, 0); destroyEach(each_blocks);
} }
}; };
} }

@ -70,7 +70,7 @@ function create_main_fragment(state, component) {
}, },
destroy: function() { destroy: function() {
destroyEach(each_blocks, false, 0); destroyEach(each_blocks);
} }
}; };
} }

Loading…
Cancel
Save