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, // 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`
if (${branch.condition}) {
${outroing} = false;
${enter}
} else if (${name} && !${outroing}) {
${outroing} = true;
@group_outros(); @group_outros();
@on_outro(() => { @on_outro(() => {
${name}.d(1); ${name}.d(1);
@ -451,20 +456,18 @@ export default class IfBlockWrapper extends Wrapper {
${name}.o(1); ${name}.o(1);
@check_outros(); @check_outros();
` }
: deindent` `);
${name}.d(1); } else {
${name} = null;
`;
block.builders.update.add_block(deindent` block.builders.update.add_block(deindent`
if (${branch.condition}) { if (${branch.condition}) {
${enter} ${enter}
} else if (${name} && !${outroing}) { } else if (${name}) {
${outroing} = true; ${name}.d(1);
${exit} ${name} = null;
} }
`); `);
}
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