get tests passing

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

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

@ -70,6 +70,7 @@ function create_fragment(ctx) {
p(changed, ctx) { p(changed, ctx) {
if (ctx.num < 5) { if (ctx.num < 5) {
outroing_if_block = false;
if (!if_block) { if (!if_block) {
if_block = create_if_block(ctx); if_block = create_if_block(ctx);
if_block.c(); if_block.c();

Loading…
Cancel
Save