mirror of https://github.com/sveltejs/svelte
fix: add compiler error for each block mutations in runes mode (#10428)
* fix: improve code generation for mutation to each block reference * fix: add compiler error for each block mutations in runes mode * lint * lint * lint * use existing validate_assignment logic * assignment, not mutation --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/10419/head
parent
976e807a3f
commit
4fcd1cb1ed
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: add compiler error for each block mutations in runes mode
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'invalid-each-assignment',
|
||||
message: 'Cannot reassign each block argument in runes mode'
|
||||
}
|
||||
});
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let arr = $state([1,2,3]);
|
||||
</script>
|
||||
|
||||
{#each arr as value}
|
||||
<button onclick={() => value += 1}>click</button>
|
||||
{/each}
|
Loading…
Reference in new issue