Browse Source

fix for OSX

Nicolas Cannasse 10 years ago
parent
commit
c27d546a47
1 changed files with 2 additions and 1 deletions
  1. 2 1
      std/js/_std/haxe/io/Bytes.hx

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

@@ -34,6 +34,7 @@ class Bytes {
 		this.length = data.byteLength;
 		this.b = new js.html.Uint8Array(data);
 		untyped {
+			b.bufferValue = data; // some impl does not return the same instance in .buffer
 			data.hxBytes = this;
 			data.bytes = this.b;
 		}
@@ -183,7 +184,7 @@ class Bytes {
 	}
 
 	public inline function getData() : BytesData {
-		return b.buffer;
+		return untyped b.bufferValue;
 	}
 
 	public static function alloc( length : Int ) : Bytes {