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

Side by Side Diff: test/dart_codegen/expect/_internal/iterable.dart

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 10 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
OLDNEW
1 part of dart._internal; 1 part of dart._internal;
2 abstract class EfficientLength {int get length; 2 abstract class EfficientLength {int get length;
3 } 3 }
4 abstract class ListIterable<E> extends IterableBase<E> implements EfficientLeng th {int get length; 4 abstract class ListIterable<E> extends IterableBase<E> implements EfficientLeng th {int get length;
5 E elementAt(int i); 5 E elementAt(int i);
6 const ListIterable(); 6 const ListIterable();
7 Iterator<E> get iterator => new ListIterator<E>(this); 7 Iterator<E> get iterator => new ListIterator<E>(this);
8 void forEach(void action(E element)) { 8 void forEach(void action(E element)) {
9 int length = this.length; 9 int length = this.length;
10 for (int i = 0; i < length; i++) { 10 for (int i = 0; i < length; i++) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 for (int i = 0; i < length; i++) { 129 for (int i = 0; i < length; i++) {
130 buffer.write(elementAt(i)); 130 buffer.write(elementAt(i));
131 if (length != this.length) { 131 if (length != this.length) {
132 throw new ConcurrentModificationError(this); 132 throw new ConcurrentModificationError(this);
133 } 133 }
134 } 134 }
135 return buffer.toString(); 135 return buffer.toString();
136 } 136 }
137 } 137 }
138 Iterable<E> where(bool test(E element)) => super.where(test); 138 Iterable<E> where(bool test(E element)) => super.where(test);
139 Iterable map(f(E element)) => new MappedListIterable(this, f); 139 Iterable map(f(E element)) => new MappedListIterable(this, DDC$RT.wrap((dynamic f(E __u1)) {
140 dynamic c(E x0) => f(DDC$RT.cast(x0, dynamic, E, "CastParam", """line 175, colum n 62 of dart:_internal/iterable.dart: """, x0 is E, false));
141 return f == null ? null : c;
142 }
143 , f, null, __t2, "Wrap", """line 175, column 62 of dart:_internal/iterable.dart: """, f is __t2));
140 E reduce(E combine(var value, E element)) { 144 E reduce(E combine(var value, E element)) {
141 int length = this.length; 145 int length = this.length;
142 if (length == 0) throw IterableElementError.noElement(); 146 if (length == 0) throw IterableElementError.noElement();
143 E value = elementAt(0); 147 E value = elementAt(0);
144 for (int i = 1; i < length; i++) { 148 for (int i = 1; i < length; i++) {
145 value = combine(value, elementAt(i)); 149 value = combine(value, elementAt(i));
146 if (length != this.length) { 150 if (length != this.length) {
147 throw new ConcurrentModificationError(this); 151 throw new ConcurrentModificationError(this);
148 } 152 }
149 } 153 }
150 return value; 154 return value;
151 } 155 }
152 fold(var initialValue, combine(var previousValue, E element)) { 156 fold(var initialValue, combine(var previousValue, E element)) {
153 var value = initialValue; 157 var value = initialValue;
154 int length = this.length; 158 int length = this.length;
155 for (int i = 0; i < length; i++) { 159 for (int i = 0; i < length; i++) {
156 value = combine(value, elementAt(i)); 160 value = combine(value, elementAt(i));
157 if (length != this.length) { 161 if (length != this.length) {
158 throw new ConcurrentModificationError(this); 162 throw new ConcurrentModificationError(this);
159 } 163 }
160 } 164 }
161 return value; 165 return value;
162 } 166 }
163 Iterable<E> skip(int count) => new SubListIterable<E>(this, count, null); 167 Iterable<E> skip(int count) => new SubListIterable<E>(this, count, ((__x6) => D DC$RT.cast(__x6, Null, int, "CastLiteral", """line 203, column 70 of dart:_inter nal/iterable.dart: """, __x6 is int, true))(null));
164 Iterable<E> skipWhile(bool test(E element)) => super.skipWhile(test); 168 Iterable<E> skipWhile(bool test(E element)) => super.skipWhile(test);
165 Iterable<E> take(int count) => new SubListIterable<E>(this, 0, count); 169 Iterable<E> take(int count) => new SubListIterable<E>(this, 0, count);
166 Iterable<E> takeWhile(bool test(E element)) => super.takeWhile(test); 170 Iterable<E> takeWhile(bool test(E element)) => super.takeWhile(test);
167 List<E> toList({ 171 List<E> toList({
168 bool growable : true} 172 bool growable : true}
169 ) { 173 ) {
170 List<E> result; 174 List<E> result;
171 if (growable) { 175 if (growable) {
172 result = new List<E>()..length = length; 176 result = new List<E>()..length = length;
173 } 177 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 int _index; 272 int _index;
269 E _current; 273 E _current;
270 ListIterator(Iterable<E> iterable) : _iterable = iterable, _length = iterable.l ength, _index = 0; 274 ListIterator(Iterable<E> iterable) : _iterable = iterable, _length = iterable.l ength, _index = 0;
271 E get current => _current; 275 E get current => _current;
272 bool moveNext() { 276 bool moveNext() {
273 int length = _iterable.length; 277 int length = _iterable.length;
274 if (_length != length) { 278 if (_length != length) {
275 throw new ConcurrentModificationError(_iterable); 279 throw new ConcurrentModificationError(_iterable);
276 } 280 }
277 if (_index >= length) { 281 if (_index >= length) {
278 _current = ((__x1) => DDC$RT.cast(__x1, Null, E, "CastLiteral", """line 338, col umn 18 of dart:_internal/iterable.dart: """, __x1 is E, false))(null); 282 _current = ((__x7) => DDC$RT.cast(__x7, Null, E, "CastLiteral", """line 338, col umn 18 of dart:_internal/iterable.dart: """, __x7 is E, false))(null);
279 return false; 283 return false;
280 } 284 }
281 _current = _iterable.elementAt(_index); 285 _current = _iterable.elementAt(_index);
282 _index++; 286 _index++;
283 return true; 287 return true;
284 } 288 }
285 } 289 }
286 typedef T _Transformation<S, T>(S value); 290 typedef T _Transformation<S, T>(S value);
287 class MappedIterable<S, T> extends IterableBase<T> {final Iterable<S> _iterable ; 291 class MappedIterable<S, T> extends IterableBase<T> {final Iterable<S> _iterable ;
288 final _Transformation<S, T> _f; 292 final _Transformation<S, T> _f;
289 factory MappedIterable(Iterable iterable, T function(S value)) { 293 factory MappedIterable(Iterable iterable, T function(S value)) {
290 if (iterable is EfficientLength) { 294 if (iterable is EfficientLength) {
291 return new EfficientLengthMappedIterable<S, T>(iterable, function); 295 return new EfficientLengthMappedIterable<S, T>(iterable, function);
292 } 296 }
293 return new MappedIterable<S, T>._(iterable, function); 297 return new MappedIterable<S, T>._(DDC$RT.cast(iterable, DDC$RT.type((Iterable<d ynamic> _) {
298 }
299 ), DDC$RT.type((Iterable<S> _) {
300 }
301 ), "CastDynamic", """line 357, column 39 of dart:_internal/iterable.dart: """, i terable is Iterable<S>, false), function);
294 } 302 }
295 MappedIterable._(this._iterable, T this._f(S element)); 303 MappedIterable._(this._iterable, T this._f(S element));
296 Iterator<T> get iterator => new MappedIterator<S, T>(_iterable.iterator, _f); 304 Iterator<T> get iterator => new MappedIterator<S, T>(_iterable.iterator, _f);
297 int get length => _iterable.length; 305 int get length => _iterable.length;
298 bool get isEmpty => _iterable.isEmpty; 306 bool get isEmpty => _iterable.isEmpty;
299 T get first => _f(_iterable.first); 307 T get first => _f(_iterable.first);
300 T get last => _f(_iterable.last); 308 T get last => _f(_iterable.last);
301 T get single => _f(_iterable.single); 309 T get single => _f(_iterable.single);
302 T elementAt(int index) => _f(_iterable.elementAt(index)); 310 T elementAt(int index) => _f(_iterable.elementAt(index));
303 } 311 }
304 class EfficientLengthMappedIterable<S, T> extends MappedIterable<S, T> implemen ts EfficientLength {EfficientLengthMappedIterable(Iterable iterable, T function( S value)) : super._(DDC$RT.cast(iterable, DDC$RT.type((Iterable<dynamic> _) { 312 class EfficientLengthMappedIterable<S, T> extends MappedIterable<S, T> implemen ts EfficientLength {EfficientLengthMappedIterable(Iterable iterable, T function( S value)) : super._(DDC$RT.cast(iterable, DDC$RT.type((Iterable<dynamic> _) {
305 } 313 }
306 ), DDC$RT.type((Iterable<S> _) { 314 ), DDC$RT.type((Iterable<S> _) {
307 } 315 }
308 ), "CastDynamic", """line 378, column 17 of dart:_internal/iterable.dart: """, i terable is Iterable<S>, false), function); 316 ), "CastDynamic", """line 378, column 17 of dart:_internal/iterable.dart: """, i terable is Iterable<S>, false), function);
309 } 317 }
310 class MappedIterator<S, T> extends Iterator<T> {T _current; 318 class MappedIterator<S, T> extends Iterator<T> {T _current;
311 final Iterator<S> _iterator; 319 final Iterator<S> _iterator;
312 final _Transformation<S, T> _f; 320 final _Transformation<S, T> _f;
313 MappedIterator(this._iterator, T this._f(S element)); 321 MappedIterator(this._iterator, T this._f(S element));
314 bool moveNext() { 322 bool moveNext() {
315 if (_iterator.moveNext()) { 323 if (_iterator.moveNext()) {
316 _current = _f(_iterator.current); 324 _current = _f(_iterator.current);
317 return true; 325 return true;
318 } 326 }
319 _current = ((__x2) => DDC$RT.cast(__x2, Null, T, "CastLiteral", """line 393, co lumn 16 of dart:_internal/iterable.dart: """, __x2 is T, false))(null); 327 _current = ((__x8) => DDC$RT.cast(__x8, Null, T, "CastLiteral", """line 393, co lumn 16 of dart:_internal/iterable.dart: """, __x8 is T, false))(null);
320 return false; 328 return false;
321 } 329 }
322 T get current => _current; 330 T get current => _current;
323 } 331 }
324 class MappedListIterable<S, T> extends ListIterable<T> implements EfficientLeng th {final Iterable<S> _source; 332 class MappedListIterable<S, T> extends ListIterable<T> implements EfficientLeng th {final Iterable<S> _source;
325 final _Transformation<S, T> _f; 333 final _Transformation<S, T> _f;
326 MappedListIterable(this._source, T this._f(S value)); 334 MappedListIterable(this._source, T this._f(S value));
327 int get length => _source.length; 335 int get length => _source.length;
328 T elementAt(int index) => _f(_source.elementAt(index)); 336 T elementAt(int index) => _f(_source.elementAt(index));
329 } 337 }
(...skipping 13 matching lines...) Expand all
343 } 351 }
344 } 352 }
345 return false; 353 return false;
346 } 354 }
347 E get current => _iterator.current; 355 E get current => _iterator.current;
348 } 356 }
349 typedef Iterable<T> _ExpandFunction<S, T>(S sourceElement); 357 typedef Iterable<T> _ExpandFunction<S, T>(S sourceElement);
350 class ExpandIterable<S, T> extends IterableBase<T> {final Iterable<S> _iterable ; 358 class ExpandIterable<S, T> extends IterableBase<T> {final Iterable<S> _iterable ;
351 final _ExpandFunction _f; 359 final _ExpandFunction _f;
352 ExpandIterable(this._iterable, Iterable<T> this._f(S element)); 360 ExpandIterable(this._iterable, Iterable<T> this._f(S element));
353 Iterator<T> get iterator => new ExpandIterator<S, T>(_iterable.iterator, _f); 361 Iterator<T> get iterator => new ExpandIterator<S, T>(_iterable.iterator, DDC$RT .wrap((Iterable<dynamic> f(dynamic __u10)) {
362 Iterable<dynamic> c(dynamic x0) => ((__x9) => DDC$RT.cast(__x9, DDC$RT.type((Ite rable<dynamic> _) {
363 }
364 ), DDC$RT.type((Iterable<T> _) {
365 }
366 ), "CastResult", """line 454, column 76 of dart:_internal/iterable.dart: """, __ x9 is Iterable<T>, false))(f(x0));
367 return f == null ? null : c;
368 }
369 , _f, null, DDC$RT.type((__t11<S, T> _) {
370 }
371 ), "Wrap", """line 454, column 76 of dart:_internal/iterable.dart: """, _f is __ t11<S, T>));
354 } 372 }
355 class ExpandIterator<S, T> implements Iterator<T> {final Iterator<S> _iterator; 373 class ExpandIterator<S, T> implements Iterator<T> {final Iterator<S> _iterator;
356 final _ExpandFunction _f; 374 final _ExpandFunction _f;
357 Iterator<T> _currentExpansion = ((__x3) => DDC$RT.cast(__x3, null, DDC$RT.type( (Iterator<T> _) { 375 Iterator<T> _currentExpansion = ((__x15) => DDC$RT.cast(__x15, null, DDC$RT.typ e((Iterator<T> _) {
358 } 376 }
359 ), "CastExact", """line 463, column 35 of dart:_internal/iterable.dart: """, __x 3 is Iterator<T>, false))(const EmptyIterator()); 377 ), "CastExact", """line 463, column 35 of dart:_internal/iterable.dart: """, __x 15 is Iterator<T>, false))(const EmptyIterator());
360 T _current; 378 T _current;
361 ExpandIterator(this._iterator, Iterable<T> this._f(S element)); 379 ExpandIterator(this._iterator, Iterable<T> this._f(S element));
362 void _nextExpansion() { 380 void _nextExpansion() {
363 } 381 }
364 T get current => _current; 382 T get current => _current;
365 bool moveNext() { 383 bool moveNext() {
366 if (_currentExpansion == null) return false; 384 if (_currentExpansion == null) return false;
367 while (!_currentExpansion.moveNext()) { 385 while (!_currentExpansion.moveNext()) {
368 _current = ((__x4) => DDC$RT.cast(__x4, Null, T, "CastLiteral", """line 476, col umn 18 of dart:_internal/iterable.dart: """, __x4 is T, false))(null); 386 _current = ((__x16) => DDC$RT.cast(__x16, Null, T, "CastLiteral", """line 476, c olumn 18 of dart:_internal/iterable.dart: """, __x16 is T, false))(null);
369 if (_iterator.moveNext()) { 387 if (_iterator.moveNext()) {
370 _currentExpansion = null; 388 _currentExpansion = null;
371 _currentExpansion = ((__x5) => DDC$RT.cast(__x5, DDC$RT.type((Iterator<dynamic> _) { 389 _currentExpansion = ((__x17) => DDC$RT.cast(__x17, DDC$RT.type((Iterator<dynami c> _) {
372 } 390 }
373 ), DDC$RT.type((Iterator<T> _) { 391 ), DDC$RT.type((Iterator<T> _) {
374 } 392 }
375 ), "CastDynamic", """line 481, column 29 of dart:_internal/iterable.dart: """, _ _x5 is Iterator<T>, false))(_f(_iterator.current).iterator); 393 ), "CastDynamic", """line 481, column 29 of dart:_internal/iterable.dart: """, _ _x17 is Iterator<T>, false))(_f(_iterator.current).iterator);
376 } 394 }
377 else { 395 else {
378 return false; 396 return false;
379 } 397 }
380 } 398 }
381 _current = _currentExpansion.current; 399 _current = _currentExpansion.current;
382 return true; 400 return true;
383 } 401 }
384 } 402 }
385 class TakeIterable<E> extends IterableBase<E> {final Iterable<E> _iterable; 403 class TakeIterable<E> extends IterableBase<E> {final Iterable<E> _iterable;
(...skipping 25 matching lines...) Expand all
411 assert (_remaining is int && _remaining >= 0);} 429 assert (_remaining is int && _remaining >= 0);}
412 bool moveNext() { 430 bool moveNext() {
413 _remaining--; 431 _remaining--;
414 if (_remaining >= 0) { 432 if (_remaining >= 0) {
415 return _iterator.moveNext(); 433 return _iterator.moveNext();
416 } 434 }
417 _remaining = -1; 435 _remaining = -1;
418 return false; 436 return false;
419 } 437 }
420 E get current { 438 E get current {
421 if (_remaining < 0) return ((__x6) => DDC$RT.cast(__x6, Null, E, "CastLiteral", """line 543, column 32 of dart:_internal/iterable.dart: """, __x6 is E, false))( null); 439 if (_remaining < 0) return ((__x18) => DDC$RT.cast(__x18, Null, E, "CastLiteral" , """line 543, column 32 of dart:_internal/iterable.dart: """, __x18 is E, false ))(null);
422 return _iterator.current; 440 return _iterator.current;
423 } 441 }
424 } 442 }
425 class TakeWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable ; 443 class TakeWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable ;
426 final _ElementPredicate _f; 444 final _ElementPredicate _f;
427 TakeWhileIterable(this._iterable, bool this._f(E element)); 445 TakeWhileIterable(this._iterable, bool this._f(E element));
428 Iterator<E> get iterator { 446 Iterator<E> get iterator {
429 return new TakeWhileIterator<E>(_iterable.iterator, _f); 447 return new TakeWhileIterator<E>(_iterable.iterator, _f);
430 } 448 }
431 } 449 }
432 class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; 450 class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator;
433 final _ElementPredicate _f; 451 final _ElementPredicate _f;
434 bool _isFinished = false; 452 bool _isFinished = false;
435 TakeWhileIterator(this._iterator, bool this._f(E element)); 453 TakeWhileIterator(this._iterator, bool this._f(E element));
436 bool moveNext() { 454 bool moveNext() {
437 if (_isFinished) return false; 455 if (_isFinished) return false;
438 if (!_iterator.moveNext() || !_f(_iterator.current)) { 456 if (!_iterator.moveNext() || !_f(_iterator.current)) {
439 _isFinished = true; 457 _isFinished = true;
440 return false; 458 return false;
441 } 459 }
442 return true; 460 return true;
443 } 461 }
444 E get current { 462 E get current {
445 if (_isFinished) return ((__x7) => DDC$RT.cast(__x7, Null, E, "CastLiteral", """ line 576, column 29 of dart:_internal/iterable.dart: """, __x7 is E, false))(nul l); 463 if (_isFinished) return ((__x19) => DDC$RT.cast(__x19, Null, E, "CastLiteral", " ""line 576, column 29 of dart:_internal/iterable.dart: """, __x19 is E, false))( null);
446 return _iterator.current; 464 return _iterator.current;
447 } 465 }
448 } 466 }
449 class SkipIterable<E> extends IterableBase<E> {final Iterable<E> _iterable; 467 class SkipIterable<E> extends IterableBase<E> {final Iterable<E> _iterable;
450 final int _skipCount; 468 final int _skipCount;
451 factory SkipIterable(Iterable<E> iterable, int count) { 469 factory SkipIterable(Iterable<E> iterable, int count) {
452 if (iterable is EfficientLength) { 470 if (iterable is EfficientLength) {
453 return new EfficientLengthSkipIterable<E>(iterable, count); 471 return new EfficientLengthSkipIterable<E>(iterable, count);
454 } 472 }
455 return new SkipIterable<E>._(iterable, count); 473 return new SkipIterable<E>._(iterable, count);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 _hasSkipped = true; 523 _hasSkipped = true;
506 while (_iterator.moveNext()) { 524 while (_iterator.moveNext()) {
507 if (!_f(_iterator.current)) return true; 525 if (!_f(_iterator.current)) return true;
508 } 526 }
509 } 527 }
510 return _iterator.moveNext(); 528 return _iterator.moveNext();
511 } 529 }
512 E get current => _iterator.current; 530 E get current => _iterator.current;
513 } 531 }
514 class EmptyIterable<E> extends IterableBase<E> implements EfficientLength {cons t EmptyIterable(); 532 class EmptyIterable<E> extends IterableBase<E> implements EfficientLength {cons t EmptyIterable();
515 Iterator<E> get iterator => ((__x8) => DDC$RT.cast(__x8, null, DDC$RT.type((Ite rator<E> _) { 533 Iterator<E> get iterator => ((__x20) => DDC$RT.cast(__x20, null, DDC$RT.type((I terator<E> _) {
516 } 534 }
517 ), "CastExact", """line 678, column 31 of dart:_internal/iterable.dart: """, __x 8 is Iterator<E>, false))(const EmptyIterator()); 535 ), "CastExact", """line 678, column 31 of dart:_internal/iterable.dart: """, __x 20 is Iterator<E>, false))(const EmptyIterator());
518 void forEach(void action(E element)) { 536 void forEach(void action(E element)) {
519 } 537 }
520 bool get isEmpty => true; 538 bool get isEmpty => true;
521 int get length => 0; 539 int get length => 0;
522 E get first { 540 E get first {
523 throw IterableElementError.noElement(); 541 throw IterableElementError.noElement();
524 } 542 }
525 E get last { 543 E get last {
526 throw IterableElementError.noElement(); 544 throw IterableElementError.noElement();
527 } 545 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 return this; 589 return this;
572 } 590 }
573 Iterable<E> takeWhile(bool test(E element)) => this; 591 Iterable<E> takeWhile(bool test(E element)) => this;
574 List toList({ 592 List toList({
575 bool growable : true} 593 bool growable : true}
576 ) => growable ? <E> [] : new List<E>(0); 594 ) => growable ? <E> [] : new List<E>(0);
577 Set toSet() => new Set<E>(); 595 Set toSet() => new Set<E>();
578 } 596 }
579 class EmptyIterator<E> implements Iterator<E> {const EmptyIterator(); 597 class EmptyIterator<E> implements Iterator<E> {const EmptyIterator();
580 bool moveNext() => false; 598 bool moveNext() => false;
581 E get current => ((__x9) => DDC$RT.cast(__x9, Null, E, "CastLiteral", """line 7 52, column 20 of dart:_internal/iterable.dart: """, __x9 is E, false))(null); 599 E get current => ((__x21) => DDC$RT.cast(__x21, Null, E, "CastLiteral", """line 752, column 20 of dart:_internal/iterable.dart: """, __x21 is E, false))(null);
582 } 600 }
583 abstract class BidirectionalIterator<T> implements Iterator<T> {bool movePrevio us(); 601 abstract class BidirectionalIterator<T> implements Iterator<T> {bool movePrevio us();
584 } 602 }
585 class IterableMixinWorkaround<T> {static bool contains(Iterable iterable, var e lement) { 603 class IterableMixinWorkaround<T> {static bool contains(Iterable iterable, var e lement) {
586 for (final e in iterable) { 604 for (final e in iterable) {
587 if (e == element) return true; 605 if (e == element) return true;
588 } 606 }
589 return false; 607 return false;
590 } 608 }
591 static void forEach(Iterable iterable, void f(o)) { 609 static void forEach(Iterable iterable, void f(o)) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 else { 753 else {
736 buffer.write(list[0]); 754 buffer.write(list[0]);
737 for (int i = 1; i < list.length; i++) { 755 for (int i = 1; i < list.length; i++) {
738 buffer.write(separator); 756 buffer.write(separator);
739 buffer.write(list[i]); 757 buffer.write(list[i]);
740 } 758 }
741 } 759 }
742 return buffer.toString(); 760 return buffer.toString();
743 } 761 }
744 Iterable<T> where(Iterable iterable, bool f(var element)) { 762 Iterable<T> where(Iterable iterable, bool f(var element)) {
745 return new WhereIterable<T>(iterable, f); 763 return new WhereIterable<T>(DDC$RT.cast(iterable, DDC$RT.type((Iterable<dynamic> _) {
764 }
765 ), DDC$RT.type((Iterable<T> _) {
766 }
767 ), "CastDynamic", """line 961, column 33 of dart:_internal/iterable.dart: """, i terable is Iterable<T>, false), f);
746 } 768 }
747 static Iterable map(Iterable iterable, f(var element)) { 769 static Iterable map(Iterable iterable, f(var element)) {
748 return new MappedIterable(iterable, f); 770 return new MappedIterable(iterable, f);
749 } 771 }
750 static Iterable mapList(List list, f(var element)) { 772 static Iterable mapList(List list, f(var element)) {
751 return new MappedListIterable(list, f); 773 return new MappedListIterable(list, f);
752 } 774 }
753 static Iterable expand(Iterable iterable, Iterable f(var element)) { 775 static Iterable expand(Iterable iterable, Iterable f(var element)) {
754 return new ExpandIterable(iterable, f); 776 return new ExpandIterable(iterable, f);
755 } 777 }
756 Iterable<T> takeList(List list, int n) { 778 Iterable<T> takeList(List list, int n) {
757 return new SubListIterable<T>(list, 0, n); 779 return new SubListIterable<T>(DDC$RT.cast(list, DDC$RT.type((List<dynamic> _) {
780 }
781 ), DDC$RT.type((Iterable<T> _) {
782 }
783 ), "CastDynamic", """line 978, column 35 of dart:_internal/iterable.dart: """, l ist is Iterable<T>, false), 0, n);
758 } 784 }
759 Iterable<T> takeWhile(Iterable iterable, bool test(var value)) { 785 Iterable<T> takeWhile(Iterable iterable, bool test(var value)) {
760 return new TakeWhileIterable<T>(iterable, test); 786 return new TakeWhileIterable<T>(DDC$RT.cast(iterable, DDC$RT.type((Iterable<dyna mic> _) {
787 }
788 ), DDC$RT.type((Iterable<T> _) {
789 }
790 ), "CastDynamic", """line 983, column 37 of dart:_internal/iterable.dart: """, i terable is Iterable<T>, false), test);
761 } 791 }
762 Iterable<T> skipList(List list, int n) { 792 Iterable<T> skipList(List list, int n) {
763 return new SubListIterable<T>(list, n, null); 793 return new SubListIterable<T>(DDC$RT.cast(list, DDC$RT.type((List<dynamic> _) {
794 }
795 ), DDC$RT.type((Iterable<T> _) {
796 }
797 ), "CastDynamic", """line 988, column 35 of dart:_internal/iterable.dart: """, l ist is Iterable<T>, false), n, ((__x22) => DDC$RT.cast(__x22, Null, int, "CastLi teral", """line 988, column 44 of dart:_internal/iterable.dart: """, __x22 is in t, true))(null));
764 } 798 }
765 Iterable<T> skipWhile(Iterable iterable, bool test(var value)) { 799 Iterable<T> skipWhile(Iterable iterable, bool test(var value)) {
766 return new SkipWhileIterable<T>(iterable, test); 800 return new SkipWhileIterable<T>(DDC$RT.cast(iterable, DDC$RT.type((Iterable<dyna mic> _) {
801 }
802 ), DDC$RT.type((Iterable<T> _) {
803 }
804 ), "CastDynamic", """line 993, column 37 of dart:_internal/iterable.dart: """, i terable is Iterable<T>, false), test);
767 } 805 }
768 Iterable<T> reversedList(List list) { 806 Iterable<T> reversedList(List list) {
769 return new ReversedListIterable<T>(list); 807 return new ReversedListIterable<T>(DDC$RT.cast(list, DDC$RT.type((List<dynamic> _) {
808 }
809 ), DDC$RT.type((Iterable<T> _) {
810 }
811 ), "CastDynamic", """line 997, column 40 of dart:_internal/iterable.dart: """, l ist is Iterable<T>, false));
770 } 812 }
771 static void sortList(List list, int compare(a, b)) { 813 static void sortList(List list, int compare(a, b)) {
772 if (compare == null) compare = DDC$RT.wrap((int f(Comparable<dynamic> __u10, Com parable<dynamic> __u11)) { 814 if (compare == null) compare = DDC$RT.wrap((int f(Comparable<dynamic> __u23, Com parable<dynamic> __u24)) {
773 int c(Comparable<dynamic> x0, Comparable<dynamic> x1) => f(DDC$RT.cast(x0, dynam ic, DDC$RT.type((Comparable<dynamic> _) { 815 int c(Comparable<dynamic> x0, Comparable<dynamic> x1) => f(DDC$RT.cast(x0, dynam ic, DDC$RT.type((Comparable<dynamic> _) {
774 } 816 }
775 ), "CastParam", """line 1001, column 36 of dart:_internal/iterable.dart: """, x0 is Comparable<dynamic>, true), DDC$RT.cast(x1, dynamic, DDC$RT.type((Comparable <dynamic> _) { 817 ), "CastParam", """line 1001, column 36 of dart:_internal/iterable.dart: """, x0 is Comparable<dynamic>, true), DDC$RT.cast(x1, dynamic, DDC$RT.type((Comparable <dynamic> _) {
776 } 818 }
777 ), "CastParam", """line 1001, column 36 of dart:_internal/iterable.dart: """, x1 is Comparable<dynamic>, true)); 819 ), "CastParam", """line 1001, column 36 of dart:_internal/iterable.dart: """, x1 is Comparable<dynamic>, true));
778 return f == null ? null : c; 820 return f == null ? null : c;
779 } 821 }
780 , Comparable.compare, __t15, __t12, "Wrap", """line 1001, column 36 of dart:_int ernal/iterable.dart: """, Comparable.compare is __t12); 822 , Comparable.compare, __t28, __t25, "Wrap", """line 1001, column 36 of dart:_int ernal/iterable.dart: """, Comparable.compare is __t25);
781 Sort.sort(list, compare); 823 Sort.sort(list, compare);
782 } 824 }
783 static void shuffleList(List list, Random random) { 825 static void shuffleList(List list, Random random) {
784 if (random == null) random = new Random(); 826 if (random == null) random = new Random();
785 int length = list.length; 827 int length = list.length;
786 while (length > 1) { 828 while (length > 1) {
787 int pos = random.nextInt(length); 829 int pos = random.nextInt(length);
788 length -= 1; 830 length -= 1;
789 var tmp = list[length]; 831 var tmp = list[length];
790 list[length] = list[pos]; 832 list[length] = list[pos];
791 list[pos] = tmp; 833 list[pos] = tmp;
792 } 834 }
793 } 835 }
794 static int indexOfList(List list, var element, int start) { 836 static int indexOfList(List list, var element, int start) {
795 return Lists.indexOf(list, element, start, list.length); 837 return Lists.indexOf(list, element, start, list.length);
796 } 838 }
797 static int lastIndexOfList(List list, var element, int start) { 839 static int lastIndexOfList(List list, var element, int start) {
798 if (start == null) start = list.length - 1; 840 if (start == null) start = list.length - 1;
799 return Lists.lastIndexOf(list, element, start); 841 return Lists.lastIndexOf(list, element, start);
800 } 842 }
801 static void _rangeCheck(List list, int start, int end) { 843 static void _rangeCheck(List list, int start, int end) {
802 RangeError.checkValidRange(start, end, list.length); 844 RangeError.checkValidRange(start, end, list.length);
803 } 845 }
804 Iterable<T> getRangeList(List list, int start, int end) { 846 Iterable<T> getRangeList(List list, int start, int end) {
805 _rangeCheck(list, start, end); 847 _rangeCheck(list, start, end);
806 return new SubListIterable<T>(list, start, end); 848 return new SubListIterable<T>(DDC$RT.cast(list, DDC$RT.type((List<dynamic> _) {
849 }
850 ), DDC$RT.type((Iterable<T> _) {
851 }
852 ), "CastDynamic", """line 1033, column 35 of dart:_internal/iterable.dart: """, list is Iterable<T>, false), start, end);
807 } 853 }
808 static void setRangeList(List list, int start, int end, Iterable from, int skip Count) { 854 static void setRangeList(List list, int start, int end, Iterable from, int skip Count) {
809 _rangeCheck(list, start, end); 855 _rangeCheck(list, start, end);
810 int length = end - start; 856 int length = end - start;
811 if (length == 0) return; if (skipCount < 0) throw new ArgumentError(skipCount); 857 if (length == 0) return; if (skipCount < 0) throw new ArgumentError(skipCount);
812 List otherList; 858 List otherList;
813 int otherStart; 859 int otherStart;
814 if (from is List) { 860 if (from is List) {
815 otherList = from; 861 otherList = from;
816 otherStart = skipCount; 862 otherStart = skipCount;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 list[index++] = element; 914 list[index++] = element;
869 } 915 }
870 } 916 }
871 static void setAllList(List list, int index, Iterable iterable) { 917 static void setAllList(List list, int index, Iterable iterable) {
872 RangeError.checkValueInInterval(index, 0, list.length, "index"); 918 RangeError.checkValueInInterval(index, 0, list.length, "index");
873 for (var element in iterable) { 919 for (var element in iterable) {
874 list[index++] = element; 920 list[index++] = element;
875 } 921 }
876 } 922 }
877 Map<int, T> asMapList(List l) { 923 Map<int, T> asMapList(List l) {
878 return new ListMapView<T>(l); 924 return new ListMapView<T>(DDC$RT.cast(l, DDC$RT.type((List<dynamic> _) {
925 }
926 ), DDC$RT.type((List<T> _) {
927 }
928 ), "CastDynamic", """line 1115, column 31 of dart:_internal/iterable.dart: """, l is List<T>, false));
879 } 929 }
880 static bool setContainsAll(Set set, Iterable other) { 930 static bool setContainsAll(Set set, Iterable other) {
881 for (var element in other) { 931 for (var element in other) {
882 if (!set.contains(element)) return false; 932 if (!set.contains(element)) return false;
883 } 933 }
884 return true; 934 return true;
885 } 935 }
886 static Set setIntersection(Set set, Set other, Set result) { 936 static Set setIntersection(Set set, Set other, Set result) {
887 Set smaller; 937 Set smaller;
888 Set larger; 938 Set larger;
(...skipping 23 matching lines...) Expand all
912 result.add(element); 962 result.add(element);
913 } 963 }
914 } 964 }
915 return result; 965 return result;
916 } 966 }
917 } 967 }
918 abstract class IterableElementError {static StateError noElement() => new State Error("No element"); 968 abstract class IterableElementError {static StateError noElement() => new State Error("No element");
919 static StateError tooMany() => new StateError("Too many elements"); 969 static StateError tooMany() => new StateError("Too many elements");
920 static StateError tooFew() => new StateError("Too few elements"); 970 static StateError tooFew() => new StateError("Too few elements");
921 } 971 }
922 typedef int __t12(dynamic __u13, dynamic __u14); 972 typedef dynamic __t2(dynamic __u3);
923 typedef int __t15(Comparable<dynamic> __u16, Comparable<dynamic> __u17); 973 typedef dynamic __t4<E>(E __u5);
974 typedef Iterable<T> __t11<S, T>(S __u12);
975 typedef Iterable<dynamic> __t13(dynamic __u14);
976 typedef int __t25(dynamic __u26, dynamic __u27);
977 typedef int __t28(Comparable<dynamic> __u29, Comparable<dynamic> __u30);
OLDNEW
« no previous file with comments | « test/codegen/expect/typed_data/typed_data.js ('k') | test/dart_codegen/expect/_internal/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698