Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: dart/sdk/lib/core/list.dart

Issue 11773043: More cuddling dart2js checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/sdk/lib/core/iterable.dart ('k') | dart/tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A [List] is an indexable collection with a length. It can be of 8 * A [List] is an indexable collection with a length. It can be of
9 * fixed size or extendable. 9 * fixed size or extendable.
10 */ 10 */
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 _current = null; 361 _current = null;
362 return false; 362 return false;
363 } 363 }
364 364
365 E get current => _current; 365 E get current => _current;
366 } 366 }
367 367
368 class MappedList<S, T> extends NonExtensibleListMixin<T> { 368 class MappedList<S, T> extends NonExtensibleListMixin<T> {
369 final List<S> _list; 369 final List<S> _list;
370 // TODO(ahe): Restore type when feature is implemented in dart2js 370 // TODO(ahe): Restore type when feature is implemented in dart2js
371 // checked mode. 371 // checked mode. http://dartbug.com/7733
372 final /* _Transformation<S, T> */ _f; 372 final /* _Transformation<S, T> */ _f;
373 373
374 MappedList(this._list, T this._f(S element)); 374 MappedList(this._list, T this._f(S element));
375 375
376 T operator[](int index) => _f(_list[index]); 376 T operator[](int index) => _f(_list[index]);
377 int get length => _list.length; 377 int get length => _list.length;
378 } 378 }
379 379
380 /** 380 /**
381 * An immutable view of a [List]. 381 * An immutable view of a [List].
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 426
427 ListView<E> take(int takeCount) { 427 ListView<E> take(int takeCount) {
428 if (takeCount is! int || takeCount < 0) { 428 if (takeCount is! int || takeCount < 0) {
429 throw new ArgumentError(takeCount); 429 throw new ArgumentError(takeCount);
430 } 430 }
431 int newLength = takeCount; 431 int newLength = takeCount;
432 if (_length != null && takeCount > _length) newLength = _length; 432 if (_length != null && takeCount > _length) newLength = _length;
433 return new ListView(_list, _offset, newLength); 433 return new ListView(_list, _offset, newLength);
434 } 434 }
435 } 435 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/core/iterable.dart ('k') | dart/tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698