-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow for whitespace in snippets declaration
- Loading branch information
1 parent
9d7907e
commit 6569127
Showing
3 changed files
with
50 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
packages/svelte2tsx/test/htmlx2jsx/samples/ts-in-template.v5/expected-svelte5.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,33 @@ | ||
<script lang="ts"></script> | ||
|
||
if(foo as true){ } else if (bar as false){ } | ||
|
||
for(let item of __sveltets_2_ensureArray(items as [''])){let i = 1;item; | ||
item as string; | ||
} | ||
|
||
{ | ||
|
||
try { const $$_value = await (foo as Promise<void>);{ const result: any = $$_value; | ||
|
||
}} catch($$_e) { const error: any = __sveltets_2_any(); | ||
|
||
}} | ||
|
||
item as string; | ||
|
||
var foo/*Ωignore_startΩ*/: import('svelte').Snippet<[string]>/*Ωignore_endΩ*/ = (bar: string) => {async () => { };return __sveltets_2_any(0)}; | ||
|
||
var foo2/*Ωignore_startΩ*/: import('svelte').Snippet<[string]>/*Ωignore_endΩ*/ = (bar : string) => {async () => { };return __sveltets_2_any(0)}; | ||
|
||
var foo3/*Ωignore_startΩ*/: import('svelte').Snippet<[string | number]>/*Ωignore_endΩ*/ = (bar : string | number) => {async () => { };return __sveltets_2_any(0)}; | ||
|
||
var foo3/*Ωignore_startΩ*/: import('svelte').Snippet<[string | number, (str: string)=>void]>/*Ωignore_endΩ*/ = (bar : string | number, baz : (str: string)=>void) => {async () => { };return __sveltets_2_any(0)}; | ||
|
||
;__sveltets_2_ensureSnippet(foo(bar as string)); | ||
|
||
{ svelteHTML.createElement("button", { "onclick":(e: Event) => {e as any},}); } | ||
{ const $$_tnenopmoC0C = __sveltets_2_ensureComponent(Component); new $$_tnenopmoC0C({ target: __sveltets_2_any(), props: { "attr":attr as boolean,}});} | ||
{ svelteHTML.createElement("label", { "id":ok!,}); } | ||
{ const $$_tnenopmoC0C = __sveltets_2_ensureComponent(Component); const $$_tnenopmoC0 = new $$_tnenopmoC0C({ target: __sveltets_2_any(), props: { }});x = $$_tnenopmoC0 as any;} | ||
{ const $$_div0 = svelteHTML.createElement("div", { });x= $$_div0.clientWidth as any;} |
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