Use Set only if it coerces -0 correctly.

This commit is contained in:
John-David Dalton
2016-04-20 01:24:00 -07:00
parent 0429434dbb
commit e3566eb1ce

View File

@@ -4880,7 +4880,7 @@
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) {
var createSet = !(Set && (1 / setToArray(new Set([-0]))[0]) == INFINITY) ? noop : function(values) {
return new Set(values);
};