mirror of https://github.com/sveltejs/svelte
implement Dev mode validation of {#each} block argument (#4419)
parent
30b09f3182
commit
3fbafe33c2
@ -0,0 +1,6 @@
|
||||
export default {
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
error: `{#each} only iterates over array-like objects. You can use a spread to convert this iterable into an array.`
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
const foo = new Set([1, 2, 3]);
|
||||
</script>
|
||||
|
||||
{#each foo as item}
|
||||
<div>{item}</div>
|
||||
{/each}
|
@ -0,0 +1,6 @@
|
||||
export default {
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
error: `{#each} only iterates over array-like objects.`
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
{#each {} as item}
|
||||
<div>{item}</div>
|
||||
{/each}
|
Loading…
Reference in new issue