mirror of https://github.com/sveltejs/svelte
fix: issue with assiging prop values as defaults of other props (#9985)
* Fix issue on assiging prop values as defaults of other props * Prettier * Add changesetpull/10008/head
parent
547ab932a8
commit
5dffe715d3
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix issue with assigning prop values as defaults of other props
|
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
let z = 8;
|
||||||
|
let { a, b = a, c = b * b, d = z * b + c } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>{a}</p>
|
||||||
|
<p>{b}</p>
|
||||||
|
<p>{c}</p>
|
||||||
|
<p>{d}</p>
|
@ -0,0 +1,5 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: `<p>5</p><p>5</p><p>25</p><p>65</p>`
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
import Test from './Test.svelte'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Test a={5} />
|
Loading…
Reference in new issue