mirror of https://github.com/sveltejs/svelte
feat: update error message for snippet binding and assignments (#11168)
* feat: update error message for snippet binding and assignments * make invalid-snippet-assignment apply in non-runes mode too * update tests * update types --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/11162/head
parent
d1976c07ff
commit
a092899843
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: update error message for snippet binding and assignments
|
@ -0,0 +1,8 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'invalid-snippet-assignment',
|
||||||
|
message: 'Cannot reassign or bind to snippet parameter'
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,3 @@
|
|||||||
|
{#snippet foo(value)}
|
||||||
|
<input bind:value={value}>
|
||||||
|
{/snippet}
|
@ -0,0 +1,8 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'invalid-snippet-assignment',
|
||||||
|
message: 'Cannot reassign or bind to snippet parameter'
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,3 @@
|
|||||||
|
{#snippet foo(value)}
|
||||||
|
<button onclick={() => value += 1}>click</button>
|
||||||
|
{/snippet}
|
Loading…
Reference in new issue