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:
parent
e691b1b7c3
commit
80d65b5acb
@ -37,5 +37,20 @@
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user