From 80e4f6bc32c0b60cd713dc61e88fdc06a2952362 Mon Sep 17 00:00:00 2001 From: pushkine Date: Mon, 13 Apr 2020 20:26:56 +0200 Subject: [PATCH] avoid empty else --- src/compiler/compile/render_dom/wrappers/IfBlock.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/compile/render_dom/wrappers/IfBlock.ts b/src/compiler/compile/render_dom/wrappers/IfBlock.ts index f67d8ddf0759..281ef506e992 100644 --- a/src/compiler/compile/render_dom/wrappers/IfBlock.ts +++ b/src/compiler/compile/render_dom/wrappers/IfBlock.ts @@ -526,7 +526,9 @@ export default class IfBlockWrapper extends Wrapper { ${name}.c(); ${has_transitions && b`@transition_in(${name}, 1);`} ${name}.m(${update_mount_node}, ${anchor}); - } else { + }${ + (dynamic || has_transitions) && + `else { ${dynamic && b`${name}.p(#ctx, #dirty);`} ${ has_transitions && @@ -534,6 +536,7 @@ export default class IfBlockWrapper extends Wrapper { @transition_in(${name}, 1); }` } + }` } `;