From bfda0f6d9ccfd37736ff4b3c37f7bc263a144b25 Mon Sep 17 00:00:00 2001 From: Thomas Jaede Date: Wed, 15 Apr 2020 13:13:15 -0700 Subject: [PATCH] Adjust Symbol null check in shim-array --- shim-array.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shim-array.js b/shim-array.js index 3bf65fc..ded006f 100644 --- a/shim-array.js +++ b/shim-array.js @@ -25,8 +25,9 @@ if (Object.freeze) { Array.nativeFrom = Array.from; +var isSymbolDefined = typeof Symbol !== "undefined"; Array.from = function (values, mapFn, thisArg) { - if(Symbol && values && typeof values[Symbol.iterator] === "function") { + if (isSymbolDefined && values && typeof values[Symbol.iterator] === "function") { return Array.nativeFrom(values, mapFn, thisArg); } //Now we add support for values that implement forEach: