Repository: flex-asjs Updated Branches: refs/heads/feature/mouseenter 173858c7d -> d299b76af
Added debug runtime checking for ArrayBuffer initializer Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d299b76a Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d299b76a Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d299b76a Branch: refs/heads/feature/mouseenter Commit: d299b76afb49b563447f3d2a38122eca280d1832 Parents: 173858c Author: Harbs <ha...@in-tools.com> Authored: Wed Jul 12 09:51:34 2017 +0300 Committer: Harbs <ha...@in-tools.com> Committed: Wed Jul 12 09:51:34 2017 +0300 ---------------------------------------------------------------------- .../Core/src/main/flex/org/apache/flex/utils/BinaryData.as | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d299b76a/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 4516f85..6d3a4d9 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 @@ -23,6 +23,10 @@ COMPILE::SWF { import flash.utils.ByteArray; } +COMPILE::JS +{ + import goog.DEBUG; +} /** @@ -58,6 +62,11 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput COMPILE::JS public function BinaryData(bytes:Object = null) { + if(goog.DEBUG) + { + if(bytes && typeof bytes.byteLength != "number") + throw new TypeError("BinaryData can only be initialized with ArrayBuffer"); + } ba = bytes ? bytes as ArrayBuffer : new ArrayBuffer(0); _len = ba.byteLength; }