Browse Source

[js] Removed references to TypedArray js.html.compat classes

George Corney 7 years ago
parent
commit
79348435b3

+ 0 - 4
std/js/_std/haxe/io/ArrayBufferView.hx

@@ -27,11 +27,7 @@ abstract ArrayBufferView(ArrayBufferViewData) {
 
 	public static var EMULATED(get,never) : Bool;
 	static inline function get_EMULATED() {
-		#if nodejs
 		return false;
-		#else
-		return (cast js.html.ArrayBuffer) == js.html.compat.ArrayBuffer;
-		#end
 	}
 
 	public var buffer(get,never) : haxe.io.Bytes;

+ 1 - 6
std/js/_std/haxe/io/Bytes.hx

@@ -21,11 +21,6 @@
  */
 package haxe.io;
 
-#if !nodejs
-import js.html.compat.Uint8Array;
-import js.html.compat.DataView;
-#end
-
 @:coreApi
 class Bytes {
 
@@ -48,7 +43,7 @@ class Bytes {
 	}
 
 	public inline function set( pos : Int, v : Int ) : Void {
-		b[pos] = v & 0xFF; // the &0xFF is necessary for js.html.compat support
+		b[pos] = v;
 	}
 
 	public function blit( pos : Int, src : Bytes, srcpos : Int, len : Int ) : Void {

+ 0 - 4
std/js/_std/haxe/io/Float32Array.hx

@@ -21,10 +21,6 @@
  */
 package haxe.io;
 
-#if !nodejs
-import js.html.compat.Float32Array;
-#end
-
 typedef Float32ArrayData = js.html.Float32Array;
 
 @:coreApi

+ 0 - 4
std/js/_std/haxe/io/Float64Array.hx

@@ -21,10 +21,6 @@
  */
 package haxe.io;
 
-#if !nodejs
-import js.html.compat.Float64Array;
-#end
-
 typedef Float64ArrayData = js.html.Float64Array;
 
 @:coreApi

+ 0 - 37
tests/unit/src/unit/issues/Issue4138.hx

@@ -1,37 +0,0 @@
-package unit.issues;
-
-#if worker
-import js.html.compat.ArrayBuffer;
-
-@:keep class Issue4138 {
-	static function main():Void {
-		var b = new js.html.ArrayBuffer(1);
-		// `Type.getClassName` uses `js.Boot.__resolveNativeClass`, thus will test for #4183 too.
-		(untyped postMessage)(Type.getClassName(Type.getClass(b)));
-	}
-}
-#else
-class Issue4138 extends unit.Test
-{
-	#if js
-	public function test()
-	{
-		var NativeArrayBuffer = untyped Function("return typeof ArrayBuffer != 'undefined' ? ArrayBuffer : null")();
-		if (js.Browser.supported && untyped js.Browser.window.Worker && NativeArrayBuffer != null){
-			async(function(_, cb){
-				var myWorker = new js.html.Worker("bin/Issue4138_Worker.js");
-				myWorker.onmessage = function(e:Dynamic){
-					var className:String = e.data;
-					f(className == Type.getClassName(js.html.compat.ArrayBuffer));
-					cb(true);
-				}
-				myWorker.onerror = function(e){
-					log('${e.message} (${e.filename}:${e.lineno})');
-					t(false);
-				}
-			}, null, true);
-		}
-	}
-	#end
-}
-#end