-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent var name clashing for delegated events without params
- Loading branch information
1 parent
dee8db5
commit 923c5cd
Showing
4 changed files
with
26 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: prevent var name clashing for delegated events without params |
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
14 changes: 14 additions & 0 deletions
14
packages/svelte/tests/runtime-runes/samples/event-without-params-clash/_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,14 @@ | ||
import { flushSync } from 'svelte'; | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
mode: ['client'], | ||
test({ assert, target, logs }) { | ||
const btn = target.querySelector('button'); | ||
|
||
flushSync(() => { | ||
btn?.click(); | ||
}); | ||
assert.deepEqual(logs, ['test']); | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/runtime-runes/samples/event-without-params-clash/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> | ||
let _ = "test" | ||
</script> | ||
|
||
<button onclick={() => { console.log(_)} }></button> |