Browse Source

if we detect Float32Array but not Float64Array, set it to "notsupported"

Nicolas Cannasse 10 years ago
parent
commit
c72b274a47

+ 1 - 1
std/js/html/compat/Float64Array.hx

@@ -110,7 +110,7 @@ class Float64Array {
 	}
 	}
 
 
 	static function __init__() untyped {
 	static function __init__() untyped {
-		var Float64Array = __js__('typeof(window) != "undefined" && window.Float64Array') || (__js__('typeof(global) != "undefined" && global.Float64Array')) || _new;
+		var Float64Array = __js__('typeof(window) != "undefined" && window.Float64Array') || __js__('typeof(window) != "undefined" && window.Float32Array && "notsupported"') || (__js__('typeof(global) != "undefined" && global.Float64Array')) || _new;
 	}
 	}
 
 
 }
 }

+ 4 - 0
tests/unit/src/unitstd/haxe/io/Float64Array.unit.hx

@@ -1,6 +1,10 @@
 
 
 var emulated = haxe.io.ArrayBufferView.EMULATED;
 var emulated = haxe.io.ArrayBufferView.EMULATED;
 
 
+#if js
+if( untyped js.html.Float64Array == "notsupported" ) return;
+#end
+
 var b = new haxe.io.Float64Array(5);
 var b = new haxe.io.Float64Array(5);
 b[0] == 0;
 b[0] == 0;
 b[4] == 0;
 b[4] == 0;