From e4fdcb43224ae92757203f3f0fec3064799f97e1 Mon Sep 17 00:00:00 2001 From: pushkine Date: Mon, 1 Jun 2020 20:32:05 +0200 Subject: [PATCH] fix --- src/runtime/internal/dev.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index 751f1f802b..d38cb8d0a0 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -1,5 +1,6 @@ import { custom_event, append, insert, detach, listen, attr } from './dom'; import { SvelteComponent } from './Component'; +import { has_Symbol } from './environment'; export function dispatch_dev(type: string, detail?: T) { document.dispatchEvent(custom_event(type, { version: '__VERSION__', ...detail })); @@ -82,7 +83,7 @@ export function set_data_dev(text, data) { export function validate_each_argument(arg) { if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) { let msg = '{#each} only iterates over array-like objects.'; - if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) { + if (has_Symbol && arg && Symbol.iterator in arg) { msg += ' You can use a spread to convert this iterable into an array.'; } throw new Error(msg);