From bfc940f39673c3d4326aafcd6ef9e531ab4a6b9d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 13 Aug 2017 22:35:42 -0400 Subject: [PATCH] handle funky edge case around outroing blocks --- src/generators/dom/Block.ts | 2 +- src/generators/dom/visitors/MustacheTag.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/generators/dom/Block.ts b/src/generators/dom/Block.ts index f851727276..069fb7f2b8 100644 --- a/src/generators/dom/Block.ts +++ b/src/generators/dom/Block.ts @@ -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); } diff --git a/src/generators/dom/visitors/MustacheTag.ts b/src/generators/dom/visitors/MustacheTag.ts index 7be3a541d9..355e3b99fc 100644 --- a/src/generators/dom/visitors/MustacheTag.ts +++ b/src/generators/dom/visitors/MustacheTag.ts @@ -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} ) ) {