mirror of https://github.com/sveltejs/svelte
parent
15c7b143f9
commit
0ac22c19b2
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "constructor_state_reassignment",
|
||||
"message": "A state field declaration in a constructor must be the first assignment, and the only one that uses a rune",
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 24
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,9 @@
|
||||
export class Counter {
|
||||
constructor() {
|
||||
if (true) {
|
||||
this.count = -1;
|
||||
}
|
||||
|
||||
this.count = $state(0);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue