From bb5e6cc016456b7bb323c1f3357ec183818f0ef5 Mon Sep 17 00:00:00 2001 From: ekhaled Date: Mon, 23 Jul 2018 15:54:33 +0100 Subject: [PATCH 1/2] add failing test for #1589 --- .../Widget.html | 1 + .../_config.js | 10 +++++++++ .../main.html | 21 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html create mode 100644 test/runtime/samples/if-block-no-outro-else-with-outro/_config.js create mode 100644 test/runtime/samples/if-block-no-outro-else-with-outro/main.html diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html b/test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html new file mode 100644 index 000000000000..c66687863ae4 --- /dev/null +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/Widget.html @@ -0,0 +1 @@ +
A wild component appears
\ No newline at end of file diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js b/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js new file mode 100644 index 000000000000..1e8ec0a9fade --- /dev/null +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/_config.js @@ -0,0 +1,10 @@ +export default { + nestedTransitions: true, + + html: '
A wild component appears

x

', + + test(assert, component, target) { + component.set({ x: 'y' }); + assert.htmlEqual(target.innerHTML, '
A wild component appears

y

'); + }, +}; diff --git a/test/runtime/samples/if-block-no-outro-else-with-outro/main.html b/test/runtime/samples/if-block-no-outro-else-with-outro/main.html new file mode 100644 index 000000000000..5789f2386e6f --- /dev/null +++ b/test/runtime/samples/if-block-no-outro-else-with-outro/main.html @@ -0,0 +1,21 @@ +{#if foo} +

foo

+{:else} + +

{x}

+ +{/if} + + \ No newline at end of file From 295675d7f1ef753c46cb273751fc2d43eca6e4a4 Mon Sep 17 00:00:00 2001 From: ekhaled Date: Mon, 23 Jul 2018 17:04:38 +0100 Subject: [PATCH 2/2] closes #1589 --- src/compile/nodes/IfBlock.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compile/nodes/IfBlock.ts b/src/compile/nodes/IfBlock.ts index 4852950429b1..2a5a49af1689 100644 --- a/src/compile/nodes/IfBlock.ts +++ b/src/compile/nodes/IfBlock.ts @@ -90,6 +90,9 @@ export default class IfBlock extends Node { dynamic = true; block.addDependencies(node.else.block.dependencies); } + + if (node.else.block.hasIntros) hasIntros = true; + if (node.else.block.hasOutros) hasOutros = true; } }