remove unused code

pull/3046/head
Richard Harris 6 years ago
parent e2b885886b
commit 152c1cb1a5

@ -146,14 +146,13 @@ export default class IfBlockWrapper extends Wrapper {
const has_else = !(this.branches[this.branches.length - 1].condition);
const if_name = has_else ? '' : `if (${name}) `;
const outroing = block.get_unique_name(`outroing_${this.var}`);
const dynamic = this.branches[0].block.has_update_method; // can use [0] as proxy for all, since they necessarily have the same value
const has_intros = this.branches[0].block.has_intro_method;
const has_outros = this.branches[0].block.has_outro_method;
const has_transitions = has_intros || has_outros;
const vars = { name, anchor, if_name, has_else, has_transitions, outroing };
const vars = { name, anchor, if_name, has_else, has_transitions };
const detaching = (parent_node && parent_node !== 'document.head') ? '' : 'detaching';
@ -391,16 +390,11 @@ export default class IfBlockWrapper extends Wrapper {
parent_node: string,
_parent_nodes: string,
dynamic,
{ name, outroing, anchor, if_name, has_transitions },
{ name, anchor, if_name, has_transitions },
detaching
) {
const branch = this.branches[0];
if (branch.block.has_outro_method) {
// TODO this probably belongs in the main render method?
block.add_variable(outroing);
}
block.builders.init.add_block(deindent`
var ${name} = (${branch.condition}) && ${branch.block.name}(ctx);
`);
@ -442,10 +436,8 @@ export default class IfBlockWrapper extends Wrapper {
if (branch.block.has_outro_method) {
block.builders.update.add_block(deindent`
if (${branch.condition}) {
${outroing} = false;
${enter}
} else if (${name} && !${outroing}) {
${outroing} = true;
} else if (${name}) {
@group_outros();
@transition_out(${name}, 1, 1, () => {
${name} = null;

@ -53,7 +53,7 @@ function create_if_block(ctx) {
}
function create_fragment(ctx) {
var outroing_if_block, if_block_anchor, current;
var if_block_anchor, current;
var if_block = (ctx.num < 5) && create_if_block(ctx);
@ -71,7 +71,6 @@ function create_fragment(ctx) {
p(changed, ctx) {
if (ctx.num < 5) {
outroing_if_block = false;
if (!if_block) {
if_block = create_if_block(ctx);
if_block.c();
@ -80,8 +79,7 @@ function create_fragment(ctx) {
} else {
transition_in(if_block, 1);
}
} else if (if_block && !outroing_if_block) {
outroing_if_block = true;
} else if (if_block) {
group_outros();
transition_out(if_block, 1, 1, () => {
if_block = null;

Loading…
Cancel
Save