OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 patch class Int8List { | 5 patch class Int8List { |
6 /* patch */ factory Int8List(int length) { | 6 /* patch */ factory Int8List(int length) { |
7 return new _Int8Array(length); | 7 return new _Int8Array(length); |
8 } | 8 } |
9 | 9 |
10 /* patch */ factory Int8List.transferable(int length) { | 10 /* patch */ factory Int8List.transferable(int length) { |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 int lengthInBytes() { | 602 int lengthInBytes() { |
603 return _length() * _BYTES_PER_ELEMENT; | 603 return _length() * _BYTES_PER_ELEMENT; |
604 } | 604 } |
605 | 605 |
606 static const int _BYTES_PER_ELEMENT = 1; | 606 static const int _BYTES_PER_ELEMENT = 1; |
607 | 607 |
608 static _Uint8ClampedArray _new(int length) native "Uint8ClampedArray_new"; | 608 static _Uint8ClampedArray _new(int length) native "Uint8ClampedArray_new"; |
609 static _Uint8ClampedArray _newTransferable(int length) | 609 static _Uint8ClampedArray _newTransferable(int length) |
610 native "Uint8ClampedArray_newTransferable"; | 610 native "Uint8ClampedArray_newTransferable"; |
611 | 611 |
612 int _getIndexed(int index) native "Uint8Array_getIndexed"; | 612 int _getIndexed(int index) native "Uint8ClampedArray_getIndexed"; |
613 int _setIndexed(int index, int value) native "Uint8Array_setIndexed"; | 613 int _setIndexed(int index, int value) native "Uint8ClampedArray_setIndexed"; |
614 } | 614 } |
615 | 615 |
616 | 616 |
617 class _Int16Array extends _ByteArrayBase implements Int16List { | 617 class _Int16Array extends _ByteArrayBase implements Int16List { |
618 factory _Int16Array(int length) { | 618 factory _Int16Array(int length) { |
619 return _new(length); | 619 return _new(length); |
620 } | 620 } |
621 | 621 |
622 factory _Int16Array.transferable(int length) { | 622 factory _Int16Array.transferable(int length) { |
623 return _newTransferable(length); | 623 return _newTransferable(length); |
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2615 } | 2615 } |
2616 _rangeCheck(this.length, start, length); | 2616 _rangeCheck(this.length, start, length); |
2617 return _array.subByteArray(_offset + start, length); | 2617 return _array.subByteArray(_offset + start, length); |
2618 } | 2618 } |
2619 | 2619 |
2620 static const int _BYTES_PER_ELEMENT = 8; | 2620 static const int _BYTES_PER_ELEMENT = 8; |
2621 final ByteArray _array; | 2621 final ByteArray _array; |
2622 final int _offset; | 2622 final int _offset; |
2623 final int _length; | 2623 final int _length; |
2624 } | 2624 } |
OLD | NEW |