mirror of https://github.com/sveltejs/svelte
snippet-param-duplicate
parent
636eaaaa6f
commit
9adebfd719
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: error at compile time when a declaration in a snippet redeclares one of its parameters
|
||||
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "declaration_duplicate",
|
||||
"message": "`item` has already been declared",
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,6 @@
|
||||
{#snippet row(item)}
|
||||
{const item = 1}
|
||||
<p>{item}</p>
|
||||
{/snippet}
|
||||
|
||||
{@render row(5)}
|
||||
@ -0,0 +1 @@
|
||||
[]
|
||||
@ -0,0 +1,8 @@
|
||||
{#snippet row(item)}
|
||||
{#if item}
|
||||
{const item = 1}
|
||||
<p>{item}</p>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{@render row(5)}
|
||||
Loading…
Reference in new issue