mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Improving typed arrays compatibility support
This commit is contained in:
parent
9fd41e11da
commit
e6b0d768fe
1 changed files with 8 additions and 1 deletions
|
@ -5,8 +5,13 @@
|
||||||
|
|
||||||
// Checking if the typed arrays are supported
|
// Checking if the typed arrays are supported
|
||||||
(function checkTypedArrayCompatibility() {
|
(function checkTypedArrayCompatibility() {
|
||||||
if (typeof Uint8Array !== 'undefined')
|
if (typeof Uint8Array !== 'undefined') {
|
||||||
|
// some mobile version might not support Float64Array
|
||||||
|
if (typeof Float64Array === 'undefined')
|
||||||
|
window.Float64Array = Float32Array;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function subarray(start, end) {
|
function subarray(start, end) {
|
||||||
return this.slice(start, end);
|
return this.slice(start, end);
|
||||||
|
@ -46,6 +51,8 @@
|
||||||
window.Uint32Array = TypedArray;
|
window.Uint32Array = TypedArray;
|
||||||
window.Int32Array = TypedArray;
|
window.Int32Array = TypedArray;
|
||||||
window.Uint16Array = TypedArray;
|
window.Uint16Array = TypedArray;
|
||||||
|
window.Float32Array = TypedArray;
|
||||||
|
window.Float64Array = TypedArray;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Object.create() ?
|
// Object.create() ?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue