mirror of https://github.com/sveltejs/svelte
Typescript each indexed (#9567)
* failing test * fix undefined index bug * Update packages/svelte/src/compiler/phases/1-parse/read/context.js Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> --------- Co-authored-by: Rich Harris <rich.harris@vercel.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/9542/head
parent
95c6b65f6f
commit
1c48d7cbdc
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: `
|
||||||
|
<span>0: a</span>
|
||||||
|
<span>1: b</span>
|
||||||
|
<span>2: c</span>
|
||||||
|
`
|
||||||
|
});
|
@ -0,0 +1,7 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let letters = ['a', 'b', 'c'];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#each letters as letter: string, i}
|
||||||
|
<span>{i}: {letter}</span>
|
||||||
|
{/each}
|
Loading…
Reference in new issue