-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: throw on invalid attribute expressions (#11736)
In runes mode only to prevent a breaking change solely from upgrading to Svelte 5 Closes #11734
- Loading branch information
1 parent
ba429fd
commit 5765752
Showing
9 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte": patch | ||
--- | ||
|
||
fix: throw on invalid attribute expressions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
error: { | ||
code: 'attribute_invalid_expression', | ||
message: 'Invalid attribute expression', | ||
position: [101, 116] | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<svelte:options runes /> | ||
<script> | ||
import Component from "./Component.svelte"; | ||
</script> | ||
|
||
<Component onclick={true}} /> |
9 changes: 9 additions & 0 deletions
9
packages/svelte/tests/compiler-errors/samples/unbalanced-curly-element/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
error: { | ||
code: 'attribute_invalid_expression', | ||
message: 'Invalid attribute expression', | ||
position: [34, 71] | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/compiler-errors/samples/unbalanced-curly-element/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<svelte:options runes /> | ||
<button | ||
onclick={() => console.log('hello')}} | ||
> | ||
click | ||
</button> |