Przeglądaj źródła

provide polyfills of ArrayBuffer and DataView

Andy Li 10 lat temu
rodzic
commit
00828b4f69

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

@@ -53,7 +53,7 @@ class ArrayBuffer {
 	}
 	}
 
 
 	static function __init__() untyped {
 	static function __init__() untyped {
-		var ArrayBuffer = untyped __js__("Function(\"return typeof ArrayBuffer != 'undefined' ? ArrayBuffer : null\")()");
+		var ArrayBuffer = untyped __js__("Function(\"return typeof ArrayBuffer != 'undefined' ? ArrayBuffer : null\")()") || js.html.compat.ArrayBuffer;
 		if( ArrayBuffer.prototype.slice == null ) ArrayBuffer.prototype.slice = sliceImpl; // IE10
 		if( ArrayBuffer.prototype.slice == null ) ArrayBuffer.prototype.slice = sliceImpl; // IE10
 	}
 	}
 }
 }

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

@@ -138,7 +138,7 @@ class DataView {
 	}
 	}
 
 
 	static function __init__() untyped {
 	static function __init__() untyped {
-		var DataView = untyped __js__("Function(\"return typeof DataView != 'undefined' ? DataView : null\")()");
+		var DataView = untyped __js__("Function(\"return typeof DataView != 'undefined' ? DataView : null\")()") || js.html.compat.DataView;
 	}
 	}
 
 
 }
 }