Skip to content

Commit

Permalink
Fix check for uninitialized condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dimfeld committed May 15, 2020
1 parent c9020d3 commit 0204140
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/compile/render_dom/wrappers/IfBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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};`)}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rrr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
html: 'eee'
};
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 0204140

Please sign in to comment.