From 5dc1cc54d5080799f53f16307f1a5b7d4627f6a3 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 21 May 2020 10:26:24 +0100 Subject: [PATCH] Add basic Array.from polyfill for IE11 --- .../@node-red/editor-client/src/js/polyfills.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/polyfills.js b/packages/node_modules/@node-red/editor-client/src/js/polyfills.js index 1a7caf121..2f6ed324c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/polyfills.js +++ b/packages/node_modules/@node-red/editor-client/src/js/polyfills.js @@ -18,17 +18,22 @@ // changes to support iterables. throw new Error("Missing Array.from base polyfill"); } - Array._from = Array.from; Array.from = function() { + if (arguments.length > 1) { + throw new Error("Node-RED's IE11 Array.from polyfill doesn't support multiple arguments"); + } var arrayLike = arguments[0] if (arrayLike.forEach) { var result = []; arrayLike.forEach(function(i) { result.push(i); }) - return result; + } else { + for (var i=0;i