mirror of https://github.com/sveltejs/svelte
fix: add validation around disallowed sequence expressions to element attributes (#11149)
parent
15eb5b5864
commit
19144b000f
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: add validation around disallowed sequence expressions to element attributes
|
@ -0,0 +1,10 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'invalid-sequence-expression',
|
||||||
|
message:
|
||||||
|
'Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses',
|
||||||
|
position: [124, 131]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
let { x, y, z } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- allowed -->
|
||||||
|
<span foo={(x, y, z)} />
|
||||||
|
|
||||||
|
<!-- not allowed -->
|
||||||
|
<span foo={x, y, z} />
|
Loading…
Reference in new issue