fix check for uninitialized `condition` (#4841)

pull/4849/head
Daniel Imfeld 4 years ago committed by GitHub
parent c9020d35b7
commit 81ade59797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -392,7 +392,7 @@ export default class IfBlockWrapper extends Wrapper {
${snippet && (
dependencies.length > 0
? b`if (${block.renderer.dirty(dependencies)}) ${condition} = !!${snippet}`
: b`if (${condition} == -1) ${condition} = !!${snippet}`
: b`if (${condition} == null) ${condition} = !!${snippet}`
)}
if (${condition}) return ${i};`
: b`return ${i};`)}

@ -0,0 +1,13 @@
<script>
import RRR from './RRR.svelte';
export let x;
</script>
{#if "Eva".startsWith('E')}
eee
{:else if x}
def
{:else}
<RRR/>
{/if}
Loading…
Cancel
Save