Add missing polyfills: Number.isNaN and Number.parseInt

This commit is contained in:
Vesa Luusua 2018-05-17 14:20:51 +03:00
parent f81f01ea3a
commit 63afe46b90

View file

@ -21,3 +21,15 @@ require('object.values').shim();
if (typeof Number.parseFloat === 'undefined' && typeof window !== 'undefined') {
Number.parseFloat = window.parseFloat;
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt
if (typeof Number.parseInt === 'undefined' && typeof window !== 'undefined') {
Number.parseInt = window.parseInt;
}
// NaN is the only value in javascript which is not equal to itself.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
if (typeof Number.isNaN === 'undefined') {
// eslint-disable-next-line no-self-compare
Number.isNaN = value => value !== value;
}