Add Number.isNaN
and Number.isInteger
polyfills in compatibility.js, since the Streams polyfill relies on them
Without this, the Streams polyfill will fail in Internet Explorer when the code-paths containing these methods are used.
This commit is contained in:
parent
2cef24a2ad
commit
f2270252c7
@ -836,6 +836,29 @@ PDFJS.compatibilityChecked = true;
|
||||
};
|
||||
})();
|
||||
|
||||
// Provides support for Number.isNaN in legacy browsers.
|
||||
// Support: IE.
|
||||
(function checkNumberIsNaN() {
|
||||
if (Number.isNaN) {
|
||||
return;
|
||||
}
|
||||
Number.isNaN = function(value) {
|
||||
return typeof value === 'number' && isNaN(value);
|
||||
};
|
||||
})();
|
||||
|
||||
// Provides support for Number.isInteger in legacy browsers.
|
||||
// Support: IE.
|
||||
(function checkNumberIsInteger() {
|
||||
if (Number.isInteger) {
|
||||
return;
|
||||
}
|
||||
Number.isInteger = function(value) {
|
||||
return typeof value === 'number' && isFinite(value) &&
|
||||
Math.floor(value) === value;
|
||||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* Polyfill for Promises:
|
||||
* The following promise implementation tries to generally implement the
|
||||
|
Loading…
Reference in New Issue
Block a user