OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 classes for Int8List ..... Float64List and ByteData implementations. | 5 // patch classes for Int8List ..... Float64List and ByteData implementations. |
6 | 6 |
7 patch class Int8List { | 7 patch class Int8List { |
8 /* patch */ factory Int8List(int length) { | 8 /* patch */ factory Int8List(int length) { |
9 return new _Int8Array(length); | 9 return new _Int8Array(length); |
10 } | 10 } |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 throw new UnsupportedError( | 400 throw new UnsupportedError( |
401 "Cannot insert into a non-extendable array"); | 401 "Cannot insert into a non-extendable array"); |
402 } | 402 } |
403 | 403 |
404 void insertAll(int index, Iterable values) { | 404 void insertAll(int index, Iterable values) { |
405 throw new UnsupportedError( | 405 throw new UnsupportedError( |
406 "Cannot insert into a non-extendable array"); | 406 "Cannot insert into a non-extendable array"); |
407 } | 407 } |
408 | 408 |
409 void sort([int compare(num a, num b)]) { | 409 void sort([int compare(num a, num b)]) { |
410 return IterableMixinWorkaround.sortList(this, compare); | 410 IterableMixinWorkaround.sortList(this, compare); |
| 411 } |
| 412 |
| 413 void shuffle() { |
| 414 IterableMixinWorkaround.shuffleList(this); |
411 } | 415 } |
412 | 416 |
413 int indexOf(element, [int start = 0]) { | 417 int indexOf(element, [int start = 0]) { |
414 return IterableMixinWorkaround.indexOfList(this, element, start); | 418 return IterableMixinWorkaround.indexOfList(this, element, start); |
415 } | 419 } |
416 | 420 |
417 int lastIndexOf(element, [int start = null]) { | 421 int lastIndexOf(element, [int start = null]) { |
418 return IterableMixinWorkaround.lastIndexOfList(this, element, start); | 422 return IterableMixinWorkaround.lastIndexOfList(this, element, start); |
419 } | 423 } |
420 | 424 |
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 return value; | 3153 return value; |
3150 } | 3154 } |
3151 return object; | 3155 return object; |
3152 } | 3156 } |
3153 | 3157 |
3154 | 3158 |
3155 void _throwRangeError(int index, int length) { | 3159 void _throwRangeError(int index, int length) { |
3156 String message = "$index must be in the range [0..$length)"; | 3160 String message = "$index must be in the range [0..$length)"; |
3157 throw new RangeError(message); | 3161 throw new RangeError(message); |
3158 } | 3162 } |
OLD | NEW |