From 9778421f30caeeff70eaebabac061df59761625f Mon Sep 17 00:00:00 2001 From: Jesse Skinner Date: Thu, 15 Oct 2020 16:22:05 -0400 Subject: [PATCH] get context at start of if update block instead of at the end, fixes #5508 --- src/compiler/compile/render_dom/wrappers/AwaitBlock.ts | 2 +- .../_config.js | 0 .../main.svelte | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename test/runtime/samples/{await-then-destruct-if-reactive => await-then-destruct-object-if}/_config.js (100%) rename test/runtime/samples/{await-then-destruct-if-reactive => await-then-destruct-object-if}/main.svelte (100%) diff --git a/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts b/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts index 2bdc31948d44..2038943d8bbc 100644 --- a/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts +++ b/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts @@ -96,7 +96,7 @@ class AwaitBlockBranch extends Wrapper { `); this.block.chunks.declarations.push(b`${get_context}(#ctx)`); if (this.block.has_update_method) { - this.block.chunks.update.push(b`${get_context}(#ctx)`); + this.block.chunks.update.unshift(b`${get_context}(#ctx)`); } } } diff --git a/test/runtime/samples/await-then-destruct-if-reactive/_config.js b/test/runtime/samples/await-then-destruct-object-if/_config.js similarity index 100% rename from test/runtime/samples/await-then-destruct-if-reactive/_config.js rename to test/runtime/samples/await-then-destruct-object-if/_config.js diff --git a/test/runtime/samples/await-then-destruct-if-reactive/main.svelte b/test/runtime/samples/await-then-destruct-object-if/main.svelte similarity index 100% rename from test/runtime/samples/await-then-destruct-if-reactive/main.svelte rename to test/runtime/samples/await-then-destruct-object-if/main.svelte