Bläddra i källkod

provide polyfills of ArrayBuffer and DataView

Andy Li 10 år sedan
förälder
incheckning
00828b4f69
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      std/js/html/compat/ArrayBuffer.hx
  2. 1 1
      std/js/html/compat/DataView.hx

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

@@ -53,7 +53,7 @@ class ArrayBuffer {
 	}
 
 	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
 	}
 }

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

@@ -138,7 +138,7 @@ class DataView {
 	}
 
 	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;
 	}
 
 }