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

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

Issue 11794047: Remove generic typedefs that dart2js chokes on. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update status files for non-browser tests 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/language/language.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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 _position = _list.length; 360 _position = _list.length;
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 final _Transformation<S, T> _f; 370 // TODO(ahe): Restore type when feature is implemented in dart2js
371 // checked mode.
372 final /* _Transformation<S, T> */ _f;
371 373
372 MappedList(this._list, T this._f(S element)); 374 MappedList(this._list, T this._f(S element));
373 375
374 T operator[](int index) => _f(_list[index]); 376 T operator[](int index) => _f(_list[index]);
375 int get length => _list.length; 377 int get length => _list.length;
376 } 378 }
377 379
378 /** 380 /**
379 * An immutable view of a [List]. 381 * An immutable view of a [List].
380 */ 382 */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 426
425 ListView<E> take(int takeCount) { 427 ListView<E> take(int takeCount) {
426 if (takeCount is! int || takeCount < 0) { 428 if (takeCount is! int || takeCount < 0) {
427 throw new ArgumentError(takeCount); 429 throw new ArgumentError(takeCount);
428 } 430 }
429 int newLength = takeCount; 431 int newLength = takeCount;
430 if (_length != null && takeCount > _length) newLength = _length; 432 if (_length != null && takeCount > _length) newLength = _length;
431 return new ListView(_list, _offset, newLength); 433 return new ListView(_list, _offset, newLength);
432 } 434 }
433 } 435 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/core/iterable.dart ('k') | dart/tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698