From e6b0d768fefe4bae7cb858dd598a63072eeff7b9 Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Fri, 30 Dec 2011 15:32:53 -0600 Subject: [PATCH] Improving typed arrays compatibility support --- web/compatibility.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/compatibility.js b/web/compatibility.js index e4e2f2440..66e46b51b 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -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() ?