mirror of https://github.com/sveltejs/svelte
commit
a33ff30e2a
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: prevent state runes from being called with spread
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
let name = 'world';
|
||||||
|
|
||||||
|
$: upper = name.toUpperCase();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input bind:value={name} />
|
||||||
|
<input bind:value={upper} />
|
||||||
|
|
||||||
|
{upper}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
let name = $state('world');
|
||||||
|
|
||||||
|
let upper = $derived(name.toUpperCase());
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input bind:value={name} />
|
||||||
|
<input bind:value={upper} />
|
||||||
|
|
||||||
|
{upper}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "rune_invalid_spread",
|
||||||
|
"end": {
|
||||||
|
"column": 35,
|
||||||
|
"line": 3
|
||||||
|
},
|
||||||
|
"message": "`$derived.by` cannot be called with a spread argument",
|
||||||
|
"start": {
|
||||||
|
"column": 15,
|
||||||
|
"line": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<script>
|
||||||
|
const args = [0];
|
||||||
|
const count = $derived.by(...args);
|
||||||
|
</script>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "rune_invalid_spread",
|
||||||
|
"end": {
|
||||||
|
"column": 32,
|
||||||
|
"line": 3
|
||||||
|
},
|
||||||
|
"message": "`$derived` cannot be called with a spread argument",
|
||||||
|
"start": {
|
||||||
|
"column": 15,
|
||||||
|
"line": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<script>
|
||||||
|
const args = [0];
|
||||||
|
const count = $derived(...args);
|
||||||
|
</script>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "rune_invalid_spread",
|
||||||
|
"end": {
|
||||||
|
"column": 34,
|
||||||
|
"line": 3
|
||||||
|
},
|
||||||
|
"message": "`$state.raw` cannot be called with a spread argument",
|
||||||
|
"start": {
|
||||||
|
"column": 15,
|
||||||
|
"line": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<script>
|
||||||
|
const args = [0];
|
||||||
|
const count = $state.raw(...args);
|
||||||
|
</script>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "rune_invalid_spread",
|
||||||
|
"end": {
|
||||||
|
"column": 30,
|
||||||
|
"line": 3
|
||||||
|
},
|
||||||
|
"message": "`$state` cannot be called with a spread argument",
|
||||||
|
"start": {
|
||||||
|
"column": 15,
|
||||||
|
"line": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<script>
|
||||||
|
const args = [0];
|
||||||
|
const count = $state(...args);
|
||||||
|
</script>
|
||||||
Loading…
Reference in new issue