Repository: flex-asjs
Updated Branches:
  refs/heads/develop f6526b7e4 -> 44fbabe7f


Fixed BinaryData constructor to take strict types


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/44fbabe7
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/44fbabe7
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/44fbabe7

Branch: refs/heads/develop
Commit: 44fbabe7f3238f70bb316795fc1751b2c610c7c6
Parents: f6526b7
Author: Harbs <[email protected]>
Authored: Sun Jul 3 11:04:51 2016 +0300
Committer: Harbs <[email protected]>
Committed: Sun Jul 3 11:04:51 2016 +0300

----------------------------------------------------------------------
 .../flex/org/apache/flex/utils/BinaryData.as    | 40 ++++++--------------
 1 file changed, 12 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44fbabe7/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as 
b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
index db7f383..88a17d1 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
@@ -45,39 +45,23 @@ public class BinaryData
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-       public function BinaryData(bytes:Object = null)
+    COMPILE::SWF
+       public function BinaryData(bytes:ByteArray = null)
        {
-        COMPILE::SWF
-        {
-            if(bytes)
-            {
-                if(!(bytes is ByteArray))
-                    throw new Error("BinaryData expects an ByteArray in the 
constructor");
-                ba = bytes as ByteArray;
-            }
-            else
-                ba = new ByteArray();
-        }
-    
-        COMPILE::JS
-        {
-            if(bytes)
-            {
-                if(!(bytes is ArrayBuffer))
-                    throw new Error("BinaryData expects an ArrayBuffer in the 
constructor");
-                ba = bytes as ArrayBuffer;
-            }
-            else
-                ba = new ArrayBuffer(0);
-        }
-               
-       }
+        ba = bytes ? bytes : new ByteArray();
+    }
+
+    COMPILE::JS
+    public function BinaryData(bytes:ArrayBuffer = null)
+    {    
+        ba = bytes ? bytes : new ArrayBuffer(0);
+    }
        
     COMPILE::SWF
-       private var ba:ByteArray = new ByteArray();
+       private var ba:ByteArray;
        
     COMPILE::JS
-    private var ba:ArrayBuffer = new ArrayBuffer(0);
+    private var ba:ArrayBuffer;
     
     COMPILE::JS
     private var _position:int = 0;

Reply via email to