mirror of https://github.com/sveltejs/svelte
parent
617df1f3c3
commit
945a90b56c
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'invalid-state-location',
|
||||||
|
message: '$state() can only be used as a variable declaration initializer or a class field',
|
||||||
|
position: process.platform === 'win32' ? [35, 43] : [33, 41]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
class X {
|
||||||
|
static x = $state();
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in new issue