bindable location fix + test

pull/10851/head
Simon Holthausen 2 years ago
parent 6ea89a3f7e
commit adc3f7a4ef

@ -891,6 +891,8 @@ export const validation_runes_js = {
error(node, 'invalid-rune-args-length', rune, [0, 1]);
} else if (rune === '$props') {
error(node, 'invalid-props-location');
} else if (rune === '$bindable') {
error(node, 'invalid-bindable-location');
}
},
AssignmentExpression(node, { state }) {

@ -0,0 +1,8 @@
import { test } from '../../test';
export default test({
error: {
code: 'invalid-bindable-location',
message: '$bindable() can only be used inside a $props() declaration'
}
});

@ -0,0 +1,3 @@
<script>
const { a = $bindable() } = $state();
</script>
Loading…
Cancel
Save