mirror of https://github.com/sveltejs/svelte
fix: throw on invalid attribute expressions (#11736)
In runes mode only to prevent a breaking change solely from upgrading to Svelte 5 Closes #11734pull/11755/head
parent
ba429fd2f1
commit
5765752d78
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: throw on invalid attribute expressions
|
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'attribute_invalid_expression',
|
||||||
|
message: 'Invalid attribute expression',
|
||||||
|
position: [101, 116]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,6 @@
|
|||||||
|
<svelte:options runes />
|
||||||
|
<script>
|
||||||
|
import Component from "./Component.svelte";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Component onclick={true}} />
|
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'attribute_invalid_expression',
|
||||||
|
message: 'Invalid attribute expression',
|
||||||
|
position: [34, 71]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,6 @@
|
|||||||
|
<svelte:options runes />
|
||||||
|
<button
|
||||||
|
onclick={() => console.log('hello')}}
|
||||||
|
>
|
||||||
|
click
|
||||||
|
</button>
|
Loading…
Reference in new issue