1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add Set(iterable) polyfill for IE11

This commit is contained in:
Nick O'Leary 2020-08-04 20:59:32 +01:00
parent e691b1b7c3
commit 80d65b5acb
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -37,5 +37,20 @@
} }
return result; return result;
} }
if (new Set([0]).size === 0) {
// IE does not support passing an iterable to Set constructor
var _Set = Set;
Set = function Set(iterable) {
var set = new _Set();
if (iterable) {
iterable.forEach(set.add, set);
}
return set;
};
Set.prototype = _Set.prototype;
Set.prototype.constructor = Set;
}
} }
})(); })();