From 7f36492a4e3b2d15226d7279e949f0b116e6d9e0 Mon Sep 17 00:00:00 2001 From: "r.proserpio" Date: Fri, 13 Mar 2020 20:43:46 +0100 Subject: [PATCH] fix failing test case for each-block-keyed-else (#4536 and #4549) --- src/compiler/compile/render_dom/wrappers/EachBlock.ts | 2 +- test/js/samples/each-block-keyed-animated/expected.js | 2 +- test/js/samples/each-block-keyed/expected.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/compile/render_dom/wrappers/EachBlock.ts b/src/compiler/compile/render_dom/wrappers/EachBlock.ts index f0dfa5fbcc..488f31dae0 100644 --- a/src/compiler/compile/render_dom/wrappers/EachBlock.ts +++ b/src/compiler/compile/render_dom/wrappers/EachBlock.ts @@ -423,7 +423,7 @@ export default class EachBlockWrapper extends Wrapper { if (all_dependencies.size) { block.chunks.update.push(b` if (${block.renderer.dirty(Array.from(all_dependencies))}) { - const ${this.vars.each_block_value} = ${snippet}; + ${this.vars.each_block_value} = ${snippet}; ${this.renderer.options.dev && b`@validate_each_argument(${this.vars.each_block_value});`} ${this.block.has_outros && b`@group_outros();`} diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index 7fb81c27a2..8d6222c676 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -93,7 +93,7 @@ function create_fragment(ctx) { }, p(ctx, [dirty]) { if (dirty & /*things*/ 1) { - const each_value = /*things*/ ctx[0]; + each_value = /*things*/ ctx[0]; for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r(); each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_destroy_block, create_each_block, each_1_anchor, get_each_context); for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].a(); diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index ad8c074e99..d6eeabf2ff 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -78,7 +78,7 @@ function create_fragment(ctx) { }, p(ctx, [dirty]) { if (dirty & /*things*/ 1) { - const each_value = /*things*/ ctx[0]; + each_value = /*things*/ ctx[0]; each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block, each_1_anchor, get_each_context); } },