HTML5 typed array fix

This commit is contained in:
Joshua Granick
2015-07-06 17:14:50 -07:00
parent 722f0d2701
commit ee08c8c37e
9 changed files with 65 additions and 47 deletions

View File

@@ -23,8 +23,10 @@ package lime.utils;
this = new js.html.Float32Array( untyped array );
} else if(view != null) {
this = new js.html.Float32Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
} else if (buffer != null) {
if (len == null)
this = new js.html.Float32Array( buffer, byteoffset );
else
this = new js.html.Float32Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -23,8 +23,10 @@ package lime.utils;
this = new js.html.Float64Array( untyped array );
} else if(view != null) {
this = new js.html.Float64Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
} else if (buffer != null) {
if (len == null)
this = new js.html.Float64Array( buffer, byteoffset );
else
this = new js.html.Float64Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Int16Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Int16Array( buffer, byteoffset );
else
this = new js.html.Int16Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Int32Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Int32Array( buffer, byteoffset );
else
this = new js.html.Int32Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Int8Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Int8Array( buffer, byteoffset );
else
this = new js.html.Int8Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Uint16Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Uint16Array( buffer, byteoffset );
else
this = new js.html.Uint16Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Uint32Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Uint32Array( buffer, byteoffset );
else
this = new js.html.Uint32Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Uint8Array( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Uint8Array( buffer, byteoffset );
else
this = new js.html.Uint8Array( buffer, byteoffset, len );
} else {
this = null;

View File

@@ -24,7 +24,9 @@ package lime.utils;
} else if(view != null) {
this = new js.html.Uint8ClampedArray( untyped view );
} else if(buffer != null) {
len = (len == null) ? untyped __js__('undefined') : len;
if (len == null)
this = new js.html.Uint8ClampedArray( buffer, byteoffset );
else
this = new js.html.Uint8ClampedArray( buffer, byteoffset, len );
} else {
this = null;