-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
$state.frozen
support (#466)
- Loading branch information
1 parent
e27a3de
commit d5b3322
Showing
10 changed files
with
12,338 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte-eslint-parser": patch | ||
--- | ||
|
||
feat: add `$state.frozen` support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-frozen-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script> | ||
let numbers = $state.frozen([1, 2, 3]); | ||
</script> | ||
|
||
<button onclick="{() => (numbers = [...numbers, numbers.length + 1])}"> | ||
push | ||
</button> | ||
|
||
<button onclick="{() => (numbers = numbers.slice(0, -1))}"> pop </button> | ||
|
||
<p> | ||
{numbers.join(" + ") || 0} | ||
= | ||
{numbers.reduce((a, b) => a + b, 0)} | ||
</p> |
Oops, something went wrong.