handle funky edge case around outroing blocks

pull/769/head
Rich Harris 8 years ago
parent caffcd5f79
commit bfc940f396

@ -195,7 +195,7 @@ export default class Block {
let outroing;
const hasOutros = !this.builders.outro.isEmpty();
if (hasOutros) {
outroing = this.getUniqueName('outroing');
outroing = this.alias('outroing');
this.addVariable(outroing);
}

@ -27,7 +27,10 @@ export default function visitMustacheTag(
);
if (dependencies.length) {
const changedCheck = dependencies.map(dependency => `'${dependency}' in changed`).join(' || ');
const changedCheck = (
( block.hasOutroMethod ? `#outroing || ` : '' ) +
dependencies.map(dependency => `'${dependency}' in changed`).join(' || ')
);
block.builders.update.addBlock(deindent`
if ( ( ${changedCheck} ) && ${value} !== ( ${value} = ${snippet} ) ) {

Loading…
Cancel
Save