mirror of https://github.com/sveltejs/svelte
throw compiler error when binding directly to const variables (#4506)
parent
0ccdca21da
commit
e06a900b23
@ -0,0 +1 @@
|
||||
[]
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
const dummy = {
|
||||
foo: 'bar'
|
||||
};
|
||||
</script>
|
||||
|
||||
<input bind:value={dummy.foo}>
|
@ -0,0 +1,15 @@
|
||||
[{
|
||||
"code": "invalid-binding",
|
||||
"message": "Cannot bind to a variable which is not writable",
|
||||
"pos": 61,
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 19,
|
||||
"character": 61
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 24,
|
||||
"character": 66
|
||||
}
|
||||
}]
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
const dummy = 'foo';
|
||||
</script>
|
||||
|
||||
<input bind:value={dummy}>
|
Loading…
Reference in new issue