mirror of https://github.com/sveltejs/svelte
parent
0aa99c63aa
commit
9ba31c79af
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'invalid-state-location',
|
||||
message: '$state() can only be used as a variable declaration initializer, a class field or a return statement if passed an object or array'
|
||||
}
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
function a() {
|
||||
return $state(1);
|
||||
}
|
||||
</script>
|
@ -0,0 +1,3 @@
|
||||
function a() {
|
||||
return $state(1);
|
||||
}
|
Loading…
Reference in new issue