Replace Number
polyfills with the ones from core-js
Since we're already using core-js elsewhere in `compatibility.js`, we can reduce the amount of code we need to maintain ourselves. https://github.com/zloirock/core-js#ecmascript-6-number
This commit is contained in:
parent
56c14e27e6
commit
dbbb763eaf
@ -845,9 +845,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
if (Number.isNaN) {
|
if (Number.isNaN) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Number.isNaN = function(value) {
|
Number.isNaN = require('core-js/fn/number/is-nan');
|
||||||
return typeof value === 'number' && isNaN(value);
|
|
||||||
};
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Provides support for Number.isInteger in legacy browsers.
|
// Provides support for Number.isInteger in legacy browsers.
|
||||||
@ -856,10 +854,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
if (Number.isInteger) {
|
if (Number.isInteger) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Number.isInteger = function(value) {
|
Number.isInteger = require('core-js/fn/number/is-integer');
|
||||||
return typeof value === 'number' && isFinite(value) &&
|
|
||||||
Math.floor(value) === value;
|
|
||||||
};
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user