loosen-state-rune
Dominic Gannaway 9 months ago
parent 0aa99c63aa
commit 9ba31c79af

@ -3,7 +3,7 @@ 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',
message: '$state() can only be used as a variable declaration initializer, a class field or a return statement if passed an object or array',
position: [33, 41]
}
});

@ -3,6 +3,6 @@ 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'
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,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>

@ -3,6 +3,6 @@ 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'
message: '$state() can only be used as a variable declaration initializer, a class field or a return statement if passed an object or array'
}
});

Loading…
Cancel
Save