mirror of https://github.com/sveltejs/svelte
fix: allow multiple optional parameters with defaults (#12070)
* fix: allow multiple optional parameters with defaults * Apply suggestions from code review * partial fix * feat: parse as a whole function * couple of fixes * work around acorn-typescript quirks * add the harder test * Update .changeset/ten-geese-share.md --------- Co-authored-by: Rich Harris <hello@rich-harris.dev> Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/12132/head
parent
5581216e4d
commit
965c12f633
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: allow multiple optional parameters with defaults in snippets
|
@ -0,0 +1,5 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: '013/023'
|
||||||
|
});
|
@ -0,0 +1,9 @@
|
|||||||
|
{#snippet one(a, b = 1, c = (2, 3))}
|
||||||
|
{a}{b}{c}
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
|
{#snippet two(a, b = (1, 2), c = 3)}
|
||||||
|
{a}{b}{c}
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
|
{@render one(0)}/{@render two(0)}
|
Loading…
Reference in new issue