Merge pull request #363 from restorer/patch-2

Fix ByteArray resizing for js target
This commit is contained in:
Joshua Granick
2015-03-04 14:52:16 -08:00

View File

@@ -1131,7 +1131,7 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa
#if js
if (allocated < value)
___resizeBuffer (allocated = Std.int (Math.max (value, allocated * 2)));
else if (allocated > value)
else if (allocated > value * 2)
___resizeBuffer (allocated = value);
length = value;
#end
@@ -1160,4 +1160,4 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa
#else
typedef ByteArray = flash.utils.ByteArray;
#end
#end