| 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.view(ByteArray array, | 10 /* patch */ factory Int8List.view(ByteArray array, |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 throw new UnsupportedError( | 177 throw new UnsupportedError( |
| 178 "Cannot add to a non-extendable array"); | 178 "Cannot add to a non-extendable array"); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void addAll(Collection value) { | 181 void addAll(Collection value) { |
| 182 throw new UnsupportedError( | 182 throw new UnsupportedError( |
| 183 "Cannot add to a non-extendable array"); | 183 "Cannot add to a non-extendable array"); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void sort([Comparator compare = Comparable.compare]) { | 186 void sort([Comparator compare = Comparable.compare]) { |
| 187 coreSort(this, compare); | 187 _Sort.sort(this, compare); |
| 188 } | 188 } |
| 189 | 189 |
| 190 int indexOf(element, [int start = 0]) { | 190 int indexOf(element, [int start = 0]) { |
| 191 return Arrays.indexOf(this, element, start, this.length); | 191 return Arrays.indexOf(this, element, start, this.length); |
| 192 } | 192 } |
| 193 | 193 |
| 194 int lastIndexOf(element, [int start = null]) { | 194 int lastIndexOf(element, [int start = null]) { |
| 195 if (start == null) start = length - 1; | 195 if (start == null) start = length - 1; |
| 196 return Arrays.lastIndexOf(this, element, start); | 196 return Arrays.lastIndexOf(this, element, start); |
| 197 } | 197 } |
| (...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1655 throw new UnsupportedError( | 1655 throw new UnsupportedError( |
| 1656 "Cannot add to a non-extendable array"); | 1656 "Cannot add to a non-extendable array"); |
| 1657 } | 1657 } |
| 1658 | 1658 |
| 1659 void addAll(Collection value) { | 1659 void addAll(Collection value) { |
| 1660 throw new UnsupportedError( | 1660 throw new UnsupportedError( |
| 1661 "Cannot add to a non-extendable array"); | 1661 "Cannot add to a non-extendable array"); |
| 1662 } | 1662 } |
| 1663 | 1663 |
| 1664 void sort([Comparator compare = Comparable.compare]) { | 1664 void sort([Comparator compare = Comparable.compare]) { |
| 1665 coreSort(this, compare); | 1665 _Sort.sort(this, compare); |
| 1666 } | 1666 } |
| 1667 | 1667 |
| 1668 int indexOf(element, [int start = 0]) { | 1668 int indexOf(element, [int start = 0]) { |
| 1669 return Arrays.indexOf(this, element, start, this.length); | 1669 return Arrays.indexOf(this, element, start, this.length); |
| 1670 } | 1670 } |
| 1671 | 1671 |
| 1672 int lastIndexOf(element, [int start = null]) { | 1672 int lastIndexOf(element, [int start = null]) { |
| 1673 if (start == null) start = length - 1; | 1673 if (start == null) start = length - 1; |
| 1674 return Arrays.lastIndexOf(this, element, start); | 1674 return Arrays.lastIndexOf(this, element, start); |
| 1675 } | 1675 } |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2411 } | 2411 } |
| 2412 _rangeCheck(this.length, start, length); | 2412 _rangeCheck(this.length, start, length); |
| 2413 return _array.subByteArray(_offset + start, length); | 2413 return _array.subByteArray(_offset + start, length); |
| 2414 } | 2414 } |
| 2415 | 2415 |
| 2416 static const int _BYTES_PER_ELEMENT = 8; | 2416 static const int _BYTES_PER_ELEMENT = 8; |
| 2417 final ByteArray _array; | 2417 final ByteArray _array; |
| 2418 final int _offset; | 2418 final int _offset; |
| 2419 final int _length; | 2419 final int _length; |
| 2420 } | 2420 } |
| OLD | NEW |