-
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for const in if blocks in new transformation #1470
- Loading branch information
1 parent
bb58b0c
commit bcf6b6a
Showing
6 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/svelte2tsx/test/htmlx2jsx/samples/if-block-const/expected.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<>{(name == "world") ? <> | ||
{@const hello = name} | ||
<h1>Hello {hello}</h1> | ||
</> : (true) ? <> | ||
{@const hello = name} | ||
<h1>Hello {hello}</h1> | ||
</> : <> | ||
{@const hello = name} | ||
<h1>Hello {hello}</h1> | ||
</> }</> |
10 changes: 10 additions & 0 deletions
10
packages/svelte2tsx/test/htmlx2jsx/samples/if-block-const/expectedv2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if(name == "world"){ | ||
const hello = name; | ||
{ svelteHTML.createElement("h1", {}); hello; } | ||
} else if (true){ | ||
const hello = name; | ||
{ svelteHTML.createElement("h1", {}); hello; } | ||
}else{ | ||
const hello = name; | ||
{ svelteHTML.createElement("h1", {}); hello; } | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/svelte2tsx/test/htmlx2jsx/samples/if-block-const/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{#if name == "world"} | ||
{@const hello = name} | ||
<h1>Hello {hello}</h1> | ||
{:else if true} | ||
{@const hello = name} | ||
<h1>Hello {hello}</h1> | ||
{:else} | ||
{@const hello = name} | ||
<h1>Hello {hello}</h1> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters