Permalink
Browse files

fix(object mixin): Add polyfill Object.is for IE

  • Loading branch information...
tmorehouse committed Sep 5, 2017
1 parent 2a34407 commit beed2c3d1f4f50eb2128d1e7f8d157515b92dd91
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/utils/object.js
@@ -35,6 +35,20 @@ if (typeof Object.assign != "function") {
};
}
// @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#Polyfill
if (!Object.is) {
Object.is = function(x, y) {
// SameValue algorithm
if (x === y) { // Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
};
}
export const assign = Object.assign;
export const getOwnPropertyNames = Object.getOwnPropertyNames;
export const keys = Object.keys;

0 comments on commit beed2c3

Please sign in to comment.