]> git.parisson.com Git - pdf.js.git/commitdiff
Improving typed arrays compatibility support
authornotmasteryet <async.processingjs@yahoo.com>
Fri, 30 Dec 2011 21:32:53 +0000 (15:32 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Fri, 30 Dec 2011 21:32:53 +0000 (15:32 -0600)
web/compatibility.js

index e4e2f2440c0702ed5640c384451bb9e49f5cec91..66e46b51b49c6b3dc0341245e708bb0c610a691e 100644 (file)
@@ -5,8 +5,13 @@
 
 // Checking if the typed arrays are supported
 (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;
+  }
 
   function subarray(start, end) {
     return this.slice(start, end);
@@ -46,6 +51,8 @@
   window.Uint32Array = TypedArray;
   window.Int32Array = TypedArray;
   window.Uint16Array = TypedArray;
+  window.Float32Array = TypedArray;
+  window.Float64Array = TypedArray;
 })();
 
 // Object.create() ?