get tests passing

pull/3031/head
Richard Harris 6 years ago
parent c0bea57547
commit 79f7236c75

@ -441,8 +441,13 @@ export default class IfBlockWrapper extends Wrapper {
// no `p()` here — we don't want to update outroing nodes,
// as that will typically result in glitching
const exit = branch.block.has_outro_method
? deindent`
if (branch.block.has_outro_method) {
block.builders.update.add_block(deindent`
if (${branch.condition}) {
${outroing} = false;
${enter}
} else if (${name} && !${outroing}) {
${outroing} = true;
@group_outros();
@on_outro(() => {
${name}.d(1);
@ -451,20 +456,18 @@ export default class IfBlockWrapper extends Wrapper {
${name}.o(1);
@check_outros();
`
: deindent`
${name}.d(1);
${name} = null;
`;
}
`);
} else {
block.builders.update.add_block(deindent`
if (${branch.condition}) {
${enter}
} else if (${name} && !${outroing}) {
${outroing} = true;
${exit}
} else if (${name}) {
${name}.d(1);
${name} = null;
}
`);
}
block.builders.destroy.add_line(`${if_name}${name}.d(${detaching});`);
}

@ -70,6 +70,7 @@ 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();

Loading…
Cancel
Save