From 70d995af7a2d50b3f956cd92086a433b36756957 Mon Sep 17 00:00:00 2001 From: Harald Fassler Date: Thu, 30 May 2019 17:44:57 +0200 Subject: [PATCH] Revert "fix #2908" This reverts commit 6e9f9187a7de1fa14681e88ab72420ab23d72050. --- src/compiler/compile/render-dom/wrappers/EachBlock.ts | 4 +--- src/runtime/internal/keyed-each.ts | 5 ----- test/js/samples/each-block-keyed-animated/expected.js | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/compiler/compile/render-dom/wrappers/EachBlock.ts b/src/compiler/compile/render-dom/wrappers/EachBlock.ts index b2dd5a7508..9208c838ad 100644 --- a/src/compiler/compile/render-dom/wrappers/EachBlock.ts +++ b/src/compiler/compile/render-dom/wrappers/EachBlock.ts @@ -343,9 +343,7 @@ export default class EachBlockWrapper extends Wrapper { const dynamic = this.block.has_update_method; const destroy = this.node.has_animation - ? (this.block.has_outros - ? `@fix_and_outro_and_destroy_block` - : `@fix_and_destroy_block`) + ? `@fix_and_outro_and_destroy_block` : this.block.has_outros ? `@outro_and_destroy_block` : `@destroy_block`; diff --git a/src/runtime/internal/keyed-each.ts b/src/runtime/internal/keyed-each.ts index f13c858897..0ec8b09400 100644 --- a/src/runtime/internal/keyed-each.ts +++ b/src/runtime/internal/keyed-each.ts @@ -13,11 +13,6 @@ export function outro_and_destroy_block(block, lookup) { block.o(1); } -export function fix_and_destroy_block(block, lookup) { - block.f(); - destroy_block(block, lookup); -} - export function fix_and_outro_and_destroy_block(block, lookup) { block.f(); outro_and_destroy_block(block, lookup); diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index ec28e60d5f..d18c569fa1 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -6,7 +6,7 @@ import { detach, element, empty, - fix_and_destroy_block, + fix_and_outro_and_destroy_block, fix_position, init, insert, @@ -100,7 +100,7 @@ function create_fragment(ctx) { p(changed, ctx) { const each_value = ctx.things; for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r(); - each_blocks = update_keyed_each(each_blocks, changed, 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); + each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_outro_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(); },