mirror of https://github.com/sveltejs/svelte
fix: prevent binding to imports (#13035)
fixes #13027 — prevents binding to imports, just like we already prevent binding to other constants (including derived values)pull/13038/head
parent
8f3f07a70b
commit
8cda791d5a
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: prevent binding to imports
|
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "constant_binding",
|
||||
"message": "Cannot bind to import",
|
||||
"start": {
|
||||
"line": 6,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 25
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
import Input from './Input.svelte';
|
||||
import { dummy } from './dummy.js';
|
||||
</script>
|
||||
|
||||
<Input bind:value={dummy} />
|
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "constant_binding",
|
||||
"message": "Cannot bind to import",
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 25
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
import { dummy } from './dummy.js';
|
||||
</script>
|
||||
|
||||
<input bind:value={dummy}>
|
Loading…
Reference in new issue