From a2368cde46f8b19ad98ef8cf4e175a2415fedebd Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 8 Jul 2018 10:55:56 -0400 Subject: [PATCH] unique name for select_block_type in IfBlock#buildCompoundWithOutros Fixes #1580 --- src/compile/nodes/IfBlock.ts | 2 +- .../Component.html | 1 + .../_config.js | 7 +++++++ .../main.html | 20 +++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 test/runtime/samples/if-block-outro-unique-select-block-type/Component.html create mode 100644 test/runtime/samples/if-block-outro-unique-select-block-type/_config.js create mode 100644 test/runtime/samples/if-block-outro-unique-select-block-type/main.html diff --git a/src/compile/nodes/IfBlock.ts b/src/compile/nodes/IfBlock.ts index 730128fc71..23ac29166e 100644 --- a/src/compile/nodes/IfBlock.ts +++ b/src/compile/nodes/IfBlock.ts @@ -250,7 +250,7 @@ export default class IfBlock extends Node { dynamic, { name, anchor, hasElse } ) { - const select_block_type = block.getUniqueName(`select_block_type`); + const select_block_type = this.compiler.getUniqueName(`select_block_type`); const current_block_type_index = block.getUniqueName(`current_block_type_index`); const previous_block_index = block.getUniqueName(`previous_block_index`); const if_block_creators = block.getUniqueName(`if_block_creators`); diff --git a/test/runtime/samples/if-block-outro-unique-select-block-type/Component.html b/test/runtime/samples/if-block-outro-unique-select-block-type/Component.html new file mode 100644 index 0000000000..7c89b545c5 --- /dev/null +++ b/test/runtime/samples/if-block-outro-unique-select-block-type/Component.html @@ -0,0 +1 @@ +
diff --git a/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js b/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js new file mode 100644 index 0000000000..f3cbb42e25 --- /dev/null +++ b/test/runtime/samples/if-block-outro-unique-select-block-type/_config.js @@ -0,0 +1,7 @@ +export default { + nestedTransitions: true, + html: ` +
+
+ `, +}; diff --git a/test/runtime/samples/if-block-outro-unique-select-block-type/main.html b/test/runtime/samples/if-block-outro-unique-select-block-type/main.html new file mode 100644 index 0000000000..a27aba9d77 --- /dev/null +++ b/test/runtime/samples/if-block-outro-unique-select-block-type/main.html @@ -0,0 +1,20 @@ +{#if foo} + +{:else} + +{/if} + +{#if foo} +
+{:else} +
+{/if} + +