Skip to content

Commit 2790d16

Browse files
fsoft72dummdidumm
andcommitted
fix: Add Child component and props to prop-p-is-null sample
This commit adds a new Child component and its props to the prop-p-is-null sample in the Svelte package. The Child component receives props using the spread operator and the props are passed as undefined. This change ensures that the Child component is properly rendered with the correct props. Co-authored-by: Simon H <[email protected]>
1 parent e886947 commit 2790d16

File tree

3 files changed

+146
-0
lines changed

3 files changed

+146
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script>
2+
$: x = Object.keys($$restProps).length;
3+
$: y = Object.keys($$props).length;
4+
</script>
5+
6+
{x} {y}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
import Child from './Child.svelte'
3+
</script>
4+
5+
<Child {...undefined} />
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"html": {
3+
"type": "Fragment",
4+
"start": 56,
5+
"end": 80,
6+
"children": [
7+
{
8+
"type": "Text",
9+
"start": 54,
10+
"end": 56,
11+
"raw": "\n\n",
12+
"data": "\n\n"
13+
},
14+
{
15+
"type": "InlineComponent",
16+
"start": 56,
17+
"end": 80,
18+
"name": "Child",
19+
"attributes": [
20+
{
21+
"type": "Spread",
22+
"start": 63,
23+
"end": 77,
24+
"expression": {
25+
"type": "Identifier",
26+
"start": 67,
27+
"end": 76,
28+
"loc": {
29+
"start": {
30+
"line": 5,
31+
"column": 11
32+
},
33+
"end": {
34+
"line": 5,
35+
"column": 20
36+
}
37+
},
38+
"name": "undefined"
39+
}
40+
}
41+
],
42+
"children": []
43+
}
44+
]
45+
},
46+
"instance": {
47+
"type": "Script",
48+
"start": 0,
49+
"end": 54,
50+
"context": "default",
51+
"content": {
52+
"type": "Program",
53+
"start": 8,
54+
"end": 45,
55+
"loc": {
56+
"start": {
57+
"line": 1,
58+
"column": 0
59+
},
60+
"end": {
61+
"line": 3,
62+
"column": 0
63+
}
64+
},
65+
"body": [
66+
{
67+
"type": "ImportDeclaration",
68+
"start": 10,
69+
"end": 44,
70+
"loc": {
71+
"start": {
72+
"line": 2,
73+
"column": 1
74+
},
75+
"end": {
76+
"line": 2,
77+
"column": 35
78+
}
79+
},
80+
"specifiers": [
81+
{
82+
"type": "ImportDefaultSpecifier",
83+
"start": 17,
84+
"end": 22,
85+
"loc": {
86+
"start": {
87+
"line": 2,
88+
"column": 8
89+
},
90+
"end": {
91+
"line": 2,
92+
"column": 13
93+
}
94+
},
95+
"local": {
96+
"type": "Identifier",
97+
"start": 17,
98+
"end": 22,
99+
"loc": {
100+
"start": {
101+
"line": 2,
102+
"column": 8
103+
},
104+
"end": {
105+
"line": 2,
106+
"column": 13
107+
}
108+
},
109+
"name": "Child"
110+
}
111+
}
112+
],
113+
"source": {
114+
"type": "Literal",
115+
"start": 28,
116+
"end": 44,
117+
"loc": {
118+
"start": {
119+
"line": 2,
120+
"column": 19
121+
},
122+
"end": {
123+
"line": 2,
124+
"column": 35
125+
}
126+
},
127+
"value": "./Child.svelte",
128+
"raw": "'./Child.svelte'"
129+
}
130+
}
131+
],
132+
"sourceType": "module"
133+
}
134+
}
135+
}

0 commit comments

Comments
 (0)