diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/expected.error.json b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/expected.error.json new file mode 100644 index 000000000..f351fbbd7 --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/expected.error.json @@ -0,0 +1,20 @@ +{ + "code": "js_parse_error", + "message": "Unexpected token\nhttps://svelte.dev/e/js_parse_error", + "filename": "(unknown)", + "start": { + "line": 1, + "column": 6, + "character": 6 + }, + "end": { + "line": 1, + "column": 6, + "character": 6 + }, + "position": [ + 6, + 6 + ], + "frame": "1:
{}
\n ^\n2: \n3:
" +} \ No newline at end of file diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/expectedv2.js b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/expectedv2.js new file mode 100644 index 000000000..cf23d1cda --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/expectedv2.js @@ -0,0 +1,7 @@ + { svelteHTML.createElement("div", {});; } + + { svelteHTML.createElement("div", {"attr": ,}); } + { svelteHTML.createElement("div", { ,}); } + + { const $$_tnenopmoC0C = __sveltets_2_ensureComponent(Component); new $$_tnenopmoC0C({ target: __sveltets_2_any(), props: {"prop": ,}}); Component} + { const $$_tnenopmoC0C = __sveltets_2_ensureComponent(Component); new $$_tnenopmoC0C({ target: __sveltets_2_any(), props: { ,}}); Component} \ No newline at end of file diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/input.svelte b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/input.svelte new file mode 100644 index 000000000..aabd2d50e --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-empty-expression.v5/input.svelte @@ -0,0 +1,7 @@ +
{}
+ +
+
+ + + diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/expected.error.json b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/expected.error.json new file mode 100644 index 000000000..73fd4ce8d --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/expected.error.json @@ -0,0 +1,20 @@ +{ + "code": "element_invalid_closing_tag", + "message": "`` attempted to close an element that was not open\nhttps://svelte.dev/e/element_invalid_closing_tag", + "filename": "(unknown)", + "start": { + "line": 3, + "column": 0, + "character": 20 + }, + "end": { + "line": 3, + "column": 0, + "character": 20 + }, + "position": [ + 20, + 20 + ], + "frame": "1:
\n2: {#if foo}\n3:
\n ^\n4: \n5:
" +} \ No newline at end of file diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/expectedv2.js b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/expectedv2.js new file mode 100644 index 000000000..b93c8d8cf --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/expectedv2.js @@ -0,0 +1,12 @@ + { svelteHTML.createElement("div", {}); + if(foo){ +} } + + { svelteHTML.createElement("div", {}); + for(let item of __sveltets_2_ensureArray(array)){ + if(i){ +}} } + + { const $$_tnenopmoC0C = __sveltets_2_ensureComponent(Component); const $$_tnenopmoC0 = new $$_tnenopmoC0C({ target: __sveltets_2_any(), props: {f:() => { async ()/*Ωignore_positionΩ*/ => { +};return __sveltets_2_any(0)},}});/*Ωignore_startΩ*/const {f} = $$_tnenopmoC0.$$prop_def;/*Ωignore_endΩ*/ + Component} \ No newline at end of file diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/input.svelte b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/input.svelte new file mode 100644 index 000000000..4b4130816 --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-block.v5/input.svelte @@ -0,0 +1,12 @@ +
+ {#if foo} +
+ +
+ {#each array as item} + {#if i} +
+ + + {#snippet f} + diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/expected.error.json b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/expected.error.json new file mode 100644 index 000000000..d7dea39f6 --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/expected.error.json @@ -0,0 +1,20 @@ +{ + "code": "expected_token", + "message": "Expected token >\nhttps://svelte.dev/e/expected_token", + "filename": "(unknown)", + "start": { + "line": 3, + "column": 2, + "character": 24 + }, + "end": { + "line": 3, + "column": 2, + "character": 24 + }, + "position": [ + 24, + 24 + ], + "frame": "1:
\n2: \n ^\n4: \n5:
" +} \ No newline at end of file diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/expectedv2.js b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/expectedv2.js new file mode 100644 index 000000000..5b87c6c58 --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/expectedv2.js @@ -0,0 +1,6 @@ + { svelteHTML.createElement("div", {}); + { const $$_pmoC1C = __sveltets_2_ensureComponent(Comp); new $$_pmoC1C({ target: __sveltets_2_any(), props: { "a":b,}}); +} } + + { svelteHTML.createElement("div", {}); + { svelteHTML.createElement("span", { "a":b,});} } \ No newline at end of file diff --git a/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/input.svelte b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/input.svelte new file mode 100644 index 000000000..154202db2 --- /dev/null +++ b/packages/svelte2tsx/test/htmlx2jsx/samples/editing-unclosed-tag.v5/input.svelte @@ -0,0 +1,7 @@ +
+ + +
+