diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 0f3f67d6b8..3209afe8a2 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -124,6 +124,7 @@ function create_fragment(ctx) { p: function update(ctx, [dirty]) { if (dirty & /*things*/ 1) { each_value = /*things*/ ctx[0]; + validate_each_argument(each_value); let i; for (i = 0; i < each_value.length; i += 1) { diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 25865a6f01..4b08be44d9 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -118,6 +118,7 @@ function create_fragment(ctx) { p: function update(ctx, [dirty]) { if (dirty & /*things*/ 1) { each_value = /*things*/ ctx[0]; + validate_each_argument(each_value); let i; for (i = 0; i < each_value.length; i += 1) { diff --git a/test/js/samples/debug-no-dependencies/expected.js b/test/js/samples/debug-no-dependencies/expected.js index 6f97e7936f..9985c814a2 100644 --- a/test/js/samples/debug-no-dependencies/expected.js +++ b/test/js/samples/debug-no-dependencies/expected.js @@ -93,6 +93,7 @@ function create_fragment(ctx) { p: function update(ctx, [dirty]) { if (dirty & /*things*/ 0) { each_value = things; + validate_each_argument(each_value); let i; for (i = 0; i < each_value.length; i += 1) { diff --git a/test/runtime/samples/dev-warning-each-block-no-sets-maps/_config.js b/test/runtime/samples/dev-warning-each-block-no-sets-maps/_config.js index 475ebc91b7..83481d9ebe 100644 --- a/test/runtime/samples/dev-warning-each-block-no-sets-maps/_config.js +++ b/test/runtime/samples/dev-warning-each-block-no-sets-maps/_config.js @@ -2,5 +2,5 @@ export default { compileOptions: { 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.` }; diff --git a/test/runtime/samples/dev-warning-each-block-no-sets-maps/main.svelte b/test/runtime/samples/dev-warning-each-block-no-sets-maps/main.svelte index 9c6ec835f9..e1aae26d12 100644 --- a/test/runtime/samples/dev-warning-each-block-no-sets-maps/main.svelte +++ b/test/runtime/samples/dev-warning-each-block-no-sets-maps/main.svelte @@ -1,5 +1,5 @@ {#each foo as item} diff --git a/test/runtime/samples/dev-warning-each-block-require-arraylike/_config.js b/test/runtime/samples/dev-warning-each-block-require-arraylike/_config.js index e0f48fb582..62e5fc209b 100644 --- a/test/runtime/samples/dev-warning-each-block-require-arraylike/_config.js +++ b/test/runtime/samples/dev-warning-each-block-require-arraylike/_config.js @@ -2,5 +2,5 @@ export default { compileOptions: { 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.` }; diff --git a/test/runtime/samples/dev-warning-each-block-require-arraylike/main.svelte b/test/runtime/samples/dev-warning-each-block-require-arraylike/main.svelte index 8b5057dfe4..f85df8d84b 100644 --- a/test/runtime/samples/dev-warning-each-block-require-arraylike/main.svelte +++ b/test/runtime/samples/dev-warning-each-block-require-arraylike/main.svelte @@ -1,7 +1,3 @@ - - -{#each foo.values() as item} +{#each {} as item}