update tests

pull/4419/head
Conduitry 6 years ago
parent fb75588163
commit ecfae03abe

@ -124,6 +124,7 @@ function create_fragment(ctx) {
p: function update(ctx, [dirty]) { p: function update(ctx, [dirty]) {
if (dirty & /*things*/ 1) { if (dirty & /*things*/ 1) {
each_value = /*things*/ ctx[0]; each_value = /*things*/ ctx[0];
validate_each_argument(each_value);
let i; let i;
for (i = 0; i < each_value.length; i += 1) { for (i = 0; i < each_value.length; i += 1) {

@ -118,6 +118,7 @@ function create_fragment(ctx) {
p: function update(ctx, [dirty]) { p: function update(ctx, [dirty]) {
if (dirty & /*things*/ 1) { if (dirty & /*things*/ 1) {
each_value = /*things*/ ctx[0]; each_value = /*things*/ ctx[0];
validate_each_argument(each_value);
let i; let i;
for (i = 0; i < each_value.length; i += 1) { for (i = 0; i < each_value.length; i += 1) {

@ -93,6 +93,7 @@ function create_fragment(ctx) {
p: function update(ctx, [dirty]) { p: function update(ctx, [dirty]) {
if (dirty & /*things*/ 0) { if (dirty & /*things*/ 0) {
each_value = things; each_value = things;
validate_each_argument(each_value);
let i; let i;
for (i = 0; i < each_value.length; i += 1) { for (i = 0; i < each_value.length; i += 1) {

@ -2,5 +2,5 @@ export default {
compileOptions: { compileOptions: {
dev: true dev: true
}, },
error: `Svelte does not allow Sets or Maps in an {#each} block. Use [...arg.values()] or [...arg.entries()] instead.` error: `{#each} only iterates over array-like objects. You can use a spread to convert this iterable into an array.`
}; };

@ -1,5 +1,5 @@
<script> <script>
const foo = new Set([1,2,3]) const foo = new Set([1, 2, 3]);
</script> </script>
{#each foo as item} {#each foo as item}

@ -2,5 +2,5 @@ export default {
compileOptions: { compileOptions: {
dev: true dev: true
}, },
error: `Svelte needs an array-like value for the {#each} block. You can spread your iterable into an array instead, e.g. [...iterable]` error: `{#each} only iterates over array-like objects.`
}; };

@ -1,7 +1,3 @@
<script> {#each {} as item}
const foo = new Set([1,2,3])
</script>
{#each foo.values() as item}
<div>{item}</div> <div>{item}</div>
{/each} {/each}
Loading…
Cancel
Save