Chromium Code Reviews| Index: runtime/lib/byte_array.dart |
| diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart |
| index a6efae205473d075a9ed794c0464b41f25f6a40b..feadf0e90a7024149f784b45fd33613a80d91da2 100644 |
| --- a/runtime/lib/byte_array.dart |
| +++ b/runtime/lib/byte_array.dart |
| @@ -1513,8 +1513,11 @@ class _ByteArrayView implements ByteArray { |
| } |
| ByteArray subByteArray([int start = 0, int length]) { |
| + if (start is! int) throw new ArgumentError("start is not an int"); |
| if (length === null) { |
|
karlklose
2012/10/11 08:18:18
Use ?length here?
|
| - length = this.lengthInBytes(); |
| + length = this.lengthInBytes() - start; |
| + } else if (length is! int) { |
| + throw new ArgumentError("length is not an int"); |
| } |
| return new _ByteArrayView(_array, _offset + start, length); |
| } |