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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 bool contains(element) => IterableMixinWorkaround.contains(this, element); | 223 bool contains(element) => IterableMixinWorkaround.contains(this, element); |
224 | 224 |
225 void forEach(void f(element)) { | 225 void forEach(void f(element)) { |
226 var len = this.length; | 226 var len = this.length; |
227 for (var i = 0; i < len; i++) { | 227 for (var i = 0; i < len; i++) { |
228 f(this[i]); | 228 f(this[i]); |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 Iterable map(f(int element)) { | |
233 return IterableMixinWorkaround.map(this, f); | |
234 } | |
235 | |
236 List mappedBy(f(int element)) { | 232 List mappedBy(f(int element)) { |
237 return IterableMixinWorkaround.mappedByList(this, f); | 233 return IterableMixinWorkaround.mappedByList(this, f); |
238 } | 234 } |
239 | 235 |
240 String join([String separator]) { | 236 String join([String separator]) { |
241 return IterableMixinWorkaround.join(this, separator); | 237 return IterableMixinWorkaround.join(this, separator); |
242 } | 238 } |
243 | 239 |
244 dynamic reduce(dynamic initialValue, | 240 dynamic reduce(dynamic initialValue, |
245 dynamic combine(dynamic initialValue, element)) { | 241 dynamic combine(dynamic initialValue, element)) { |
246 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 242 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
247 } | 243 } |
248 | 244 |
249 Collection where(bool f(element)) { | 245 Collection where(bool f(element)) { |
250 return IterableMixinWorkaround.where(this, f); | 246 return IterableMixinWorkaround.where(this, f); |
251 } | 247 } |
252 | 248 |
253 Iterable<int> take(int n) { | 249 List<int> take(int n) { |
254 return IterableMixinWorkaround.takeList(this, n); | 250 return IterableMixinWorkaround.takeList(this, n); |
255 } | 251 } |
256 | 252 |
257 Iterable<int> takeWhile(bool test(int value)) { | 253 Iterable<int> takeWhile(bool test(int value)) { |
258 return IterableMixinWorkaround.takeWhile(this, test); | 254 return IterableMixinWorkaround.takeWhile(this, test); |
259 } | 255 } |
260 | 256 |
261 Iterable<int> skip(int n) { | 257 List<int> skip(int n) { |
262 return IterableMixinWorkaround.skipList(this, n); | 258 return IterableMixinWorkaround.skipList(this, n); |
263 } | 259 } |
264 | 260 |
265 Iterable<int> skipWhile(bool test(int value)) { | 261 Iterable<int> skipWhile(bool test(int value)) { |
266 return IterableMixinWorkaround.skipWhile(this, test); | 262 return IterableMixinWorkaround.skipWhile(this, test); |
267 } | 263 } |
268 | 264 |
269 bool every(bool f(element)) { | 265 bool every(bool f(element)) { |
270 return IterableMixinWorkaround.every(this, f); | 266 return IterableMixinWorkaround.every(this, f); |
271 } | 267 } |
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2673 ByteArray asByteArray([int start = 0, int length]) { | 2669 ByteArray asByteArray([int start = 0, int length]) { |
2674 if (length == null) { | 2670 if (length == null) { |
2675 length = this.lengthInBytes(); | 2671 length = this.lengthInBytes(); |
2676 } | 2672 } |
2677 _rangeCheck(this.length, start, length); | 2673 _rangeCheck(this.length, start, length); |
2678 return _array.subByteArray(_offset + start, length); | 2674 return _array.subByteArray(_offset + start, length); |
2679 } | 2675 } |
2680 | 2676 |
2681 static const int _BYTES_PER_ELEMENT = 8; | 2677 static const int _BYTES_PER_ELEMENT = 8; |
2682 } | 2678 } |
OLD | NEW |