Skip to content

Commit 424f221

Browse files
committed
tests for S-nodes
1 parent 5c1c81e commit 424f221

File tree

24 files changed

+115
-0
lines changed

24 files changed

+115
-0
lines changed

packages/svelte/src/compiler/print/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ const visitors = {
733733
context.visit(attribute);
734734
}
735735

736+
// TODO handling of self-closing does not seem to work
736737
if (node.fragment) {
737738
context.write('>');
738739
block(context, node.fragment, true);
@@ -751,6 +752,7 @@ const visitors = {
751752
context.visit(attribute);
752753
}
753754

755+
// TODO handling of self-closing does not seem to work
754756
if (node.fragment) {
755757
context.write('>');
756758
block(context, node.fragment, true);
@@ -763,6 +765,7 @@ const visitors = {
763765
SvelteElement(node, context) {
764766
context.write('<svelte:element');
765767

768+
// TODO spaces at interesting places
766769
context.write('this={');
767770
context.visit(node.tag);
768771
context.write('} ');
@@ -773,6 +776,7 @@ const visitors = {
773776
context.visit(attribute);
774777
}
775778

779+
// TODO new line handling not working?
776780
if (node.fragment) {
777781
context.write('>');
778782
block(context, node.fragment, true);
@@ -827,6 +831,7 @@ const visitors = {
827831
context.visit(attribute);
828832
}
829833

834+
// TODO handling of self-closing does not seem to work
830835
if (node.fragment) {
831836
context.write('>');
832837
block(context, node.fragment, true);
@@ -845,6 +850,7 @@ const visitors = {
845850
context.visit(attribute);
846851
}
847852

853+
// TODO handling of self-closing does not seem to work
848854
if (node.fragment) {
849855
context.write('>');
850856
block(context, node.fragment, true);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="modal">
2+
<slot></slot>
3+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="modal"><slot /></div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{#snippet name(param1, param2, paramN)}
2+
Foo
3+
{/snippet}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{#snippet name(param1, param2, paramN)}
2+
Foo
3+
{/snippet}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div {...props}></div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div {...props}></div>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div style:color="red">...</div>
2+
<div style:color style:width="12rem" style:background-color={darkMode ? 'black' : 'white'}>...</div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div style:color="red">...</div>
2+
<div style:color style:width="12rem" style:background-color={darkMode ? 'black' : 'white'}>
3+
...
4+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<svelte:boundary>
2+
<p>{await delayed('hello!')}</p>
3+
4+
{#snippet pending()}
5+
<p>loading...</p>
6+
{/snippet}
7+
</svelte:boundary>

0 commit comments

Comments
 (0)