mirror of https://github.com/sveltejs/svelte
fix: disallow sequence expressions in `@const` tags (#11357)
* fix: disallow sequence expressions in `@const` tags closes #11349 * allow parenthesized sequence expressionpull/11385/head
parent
0cf10a361e
commit
5e0845fe3e
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: disallow sequence expressions in `@const` tags
|
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'const_tag_invalid_expression',
|
||||||
|
message: '{@const ...} must consist of a single variable declaration',
|
||||||
|
position: [75, 93]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,7 @@
|
|||||||
|
{#if true}
|
||||||
|
{@const foo = ('bar', 'baz')}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if true}
|
||||||
|
{@const foo = 'foo', bar = 'bar'}
|
||||||
|
{/if}
|
Loading…
Reference in new issue