mirror of https://github.com/sveltejs/svelte
fix: handle shadowed function names correctly (#17753)
Fixes #17750 (though the change that causes the issue only surfaced this more general bug) We were not adding the correct scope to function ids. Instead it was part of the function body/params scope, which leads to bugs when the function name is shadowed within the function.pull/17755/head
parent
7106da4dd2
commit
0c7f815143
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: handle shadowed function names correctly
|
||||
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `42`
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
<script module>
|
||||
function foo() {
|
||||
const foo = $derived(42);
|
||||
return () => foo;
|
||||
}
|
||||
</script>
|
||||
|
||||
{foo()()}
|
||||
Loading…
Reference in new issue