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

Side by Side Diff: lib/runtime/dart/collection.js

Issue 1020043002: Replace dart_core.js with actual compiled SDK (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merge Created 5 years, 9 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
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/convert.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var collection; 1 var collection;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 let _source = Symbol('_source'); 4 let _source = Symbol('_source');
5 let UnmodifiableListView$ = dart.generic(function(E) { 5 let UnmodifiableListView$ = dart.generic(function(E) {
6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) {
7 UnmodifiableListView(source) { 7 UnmodifiableListView(source) {
8 this[_source] = source; 8 this[_source] = source;
9 super.UnmodifiableListBase(); 9 super.UnmodifiableListBase();
10 } 10 }
(...skipping 11 matching lines...) Expand all
22 function _defaultEquals(a, b) { 22 function _defaultEquals(a, b) {
23 return dart.equals(a, b); 23 return dart.equals(a, b);
24 } 24 }
25 // Function _defaultHashCode: (dynamic) → int 25 // Function _defaultHashCode: (dynamic) → int
26 function _defaultHashCode(a) { 26 function _defaultHashCode(a) {
27 return dart.as(dart.dload(a, 'hashCode'), core.int); 27 return dart.as(dart.dload(a, 'hashCode'), core.int);
28 } 28 }
29 let HashMap$ = dart.generic(function(K, V) { 29 let HashMap$ = dart.generic(function(K, V) {
30 class HashMap extends core.Object { 30 class HashMap extends core.Object {
31 HashMap(opt$) { 31 HashMap(opt$) {
32 let equals = opt$.equals === void 0 ? null : opt$.equals; 32 let equals = opt$ && 'equals' in opt$ ? opt$.equals : null;
33 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; 33 let hashCode = opt$ && 'hashCode' in opt$ ? opt$.hashCode : null;
34 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; 34 let isValidKey = opt$ && 'isValidKey' in opt$ ? opt$.isValidKey : null;
35 if (isValidKey === null) { 35 if (isValidKey === null) {
36 if (hashCode === null) { 36 if (hashCode === null) {
37 if (equals === null) { 37 if (equals === null) {
38 return new _HashMap(); 38 return new _HashMap();
39 } 39 }
40 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 40 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int");
41 } else { 41 } else {
42 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 42 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
43 return new _IdentityHashMap(); 43 return new _IdentityHashMap();
44 } 44 }
(...skipping 15 matching lines...) Expand all
60 return new _IdentityHashMap(); 60 return new _IdentityHashMap();
61 } 61 }
62 HashMap$from(other) { 62 HashMap$from(other) {
63 let result = new HashMap(); 63 let result = new HashMap();
64 other.forEach((k, v) => { 64 other.forEach((k, v) => {
65 result.set(k, dart.as(v, V)); 65 result.set(k, dart.as(v, V));
66 }); 66 });
67 return result; 67 return result;
68 } 68 }
69 HashMap$fromIterable(iterable, opt$) { 69 HashMap$fromIterable(iterable, opt$) {
70 let key = opt$.key === void 0 ? null : opt$.key; 70 let key = opt$ && 'key' in opt$ ? opt$.key : null;
71 let value = opt$.value === void 0 ? null : opt$.value; 71 let value = opt$ && 'value' in opt$ ? opt$.value : null;
72 let map = new HashMap(); 72 let map = new HashMap();
73 Maps._fillMapWithMappedIterable(map, iterable, key, value); 73 Maps._fillMapWithMappedIterable(map, iterable, key, value);
74 return map; 74 return map;
75 } 75 }
76 HashMap$fromIterables(keys, values) { 76 HashMap$fromIterables(keys, values) {
77 let map = new HashMap(); 77 let map = new HashMap();
78 Maps._fillMapWithIterables(map, keys, values); 78 Maps._fillMapWithIterables(map, keys, values);
79 return map; 79 return map;
80 } 80 }
81 } 81 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 difference(other) { 153 difference(other) {
154 let result = this.toSet(); 154 let result = this.toSet();
155 for (let element of this) { 155 for (let element of this) {
156 if (other.contains(element)) 156 if (other.contains(element))
157 result.remove(element); 157 result.remove(element);
158 } 158 }
159 return result; 159 return result;
160 } 160 }
161 toList(opt$) { 161 toList(opt$) {
162 let growable = opt$.growable === void 0 ? true : opt$.growable; 162 let growable = opt$ && 'growable' in opt$ ? opt$.growable : true;
163 let result = growable ? ((_) => { 163 let result = growable ? ((_) => {
164 _.length = this.length; 164 _.length = this.length;
165 return _; 165 return _;
166 }).bind(this)(new core.List()) : new core.List(this.length); 166 }).bind(this)(new core.List()) : new core.List(this.length);
167 let i = 0; 167 let i = 0;
168 for (let element of this) 168 for (let element of this)
169 result.set((($tmp) => i = dart.notNull($tmp) + 1, $tmp)(i), element); 169 result.set((($tmp) => i = dart.notNull($tmp) + 1, $tmp)(i), element);
170 return result; 170 return result;
171 } 171 }
172 map(f) { 172 map(f) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (!dart.notNull(it.moveNext())) { 269 if (!dart.notNull(it.moveNext())) {
270 throw _internal.IterableElementError.noElement(); 270 throw _internal.IterableElementError.noElement();
271 } 271 }
272 let result = null; 272 let result = null;
273 do { 273 do {
274 result = dart.as(it.current, E); 274 result = dart.as(it.current, E);
275 } while (it.moveNext()); 275 } while (it.moveNext());
276 return result; 276 return result;
277 } 277 }
278 firstWhere(test, opt$) { 278 firstWhere(test, opt$) {
279 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 279 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
280 for (let element of this) { 280 for (let element of this) {
281 if (test(element)) 281 if (test(element))
282 return element; 282 return element;
283 } 283 }
284 if (orElse !== null) 284 if (orElse !== null)
285 return orElse(); 285 return orElse();
286 throw _internal.IterableElementError.noElement(); 286 throw _internal.IterableElementError.noElement();
287 } 287 }
288 lastWhere(test, opt$) { 288 lastWhere(test, opt$) {
289 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 289 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
290 let result = null; 290 let result = null;
291 let foundMatching = false; 291 let foundMatching = false;
292 for (let element of this) { 292 for (let element of this) {
293 if (test(element)) { 293 if (test(element)) {
294 result = element; 294 result = element;
295 foundMatching = true; 295 foundMatching = true;
296 } 296 }
297 } 297 }
298 if (foundMatching) 298 if (foundMatching)
299 return result; 299 return result;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return _; 366 return _;
367 }).bind(this)(this[_newSet]()); 367 }).bind(this)(this[_newSet]());
368 } 368 }
369 } 369 }
370 return _HashSetBase; 370 return _HashSetBase;
371 }); 371 });
372 let _HashSetBase = _HashSetBase$(dart.dynamic); 372 let _HashSetBase = _HashSetBase$(dart.dynamic);
373 let HashSet$ = dart.generic(function(E) { 373 let HashSet$ = dart.generic(function(E) {
374 class HashSet extends core.Object { 374 class HashSet extends core.Object {
375 HashSet(opt$) { 375 HashSet(opt$) {
376 let equals = opt$.equals === void 0 ? null : opt$.equals; 376 let equals = opt$ && 'equals' in opt$ ? opt$.equals : null;
377 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; 377 let hashCode = opt$ && 'hashCode' in opt$ ? opt$.hashCode : null;
378 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; 378 let isValidKey = opt$ && 'isValidKey' in opt$ ? opt$.isValidKey : null;
379 if (isValidKey === null) { 379 if (isValidKey === null) {
380 if (hashCode === null) { 380 if (hashCode === null) {
381 if (equals === null) { 381 if (equals === null) {
382 return new _HashSet(); 382 return new _HashSet();
383 } 383 }
384 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 384 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int");
385 } else { 385 } else {
386 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 386 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
387 return new _IdentityHashSet(); 387 return new _IdentityHashSet();
388 } 388 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 return buffer.toString(); 482 return buffer.toString();
483 } 483 }
484 any(f) { 484 any(f) {
485 for (let element of this) { 485 for (let element of this) {
486 if (f(element)) 486 if (f(element))
487 return true; 487 return true;
488 } 488 }
489 return false; 489 return false;
490 } 490 }
491 toList(opt$) { 491 toList(opt$) {
492 let growable = opt$.growable === void 0 ? true : opt$.growable; 492 let growable = opt$ && 'growable' in opt$ ? opt$.growable : true;
493 return new core.List.from(this, {growable: growable}); 493 return new core.List.from(this, {growable: growable});
494 } 494 }
495 toSet() { 495 toSet() {
496 return new core.Set.from(this); 496 return new core.Set.from(this);
497 } 497 }
498 get length() { 498 get length() {
499 dart.assert(!dart.is(this, _internal.EfficientLength)); 499 dart.assert(!dart.is(this, _internal.EfficientLength));
500 let count = 0; 500 let count = 0;
501 let it = this.iterator; 501 let it = this.iterator;
502 while (it.moveNext()) { 502 while (it.moveNext()) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 get single() { 543 get single() {
544 let it = this.iterator; 544 let it = this.iterator;
545 if (!dart.notNull(it.moveNext())) 545 if (!dart.notNull(it.moveNext()))
546 throw _internal.IterableElementError.noElement(); 546 throw _internal.IterableElementError.noElement();
547 let result = dart.as(it.current, E); 547 let result = dart.as(it.current, E);
548 if (it.moveNext()) 548 if (it.moveNext())
549 throw _internal.IterableElementError.tooMany(); 549 throw _internal.IterableElementError.tooMany();
550 return result; 550 return result;
551 } 551 }
552 firstWhere(test, opt$) { 552 firstWhere(test, opt$) {
553 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 553 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
554 for (let element of this) { 554 for (let element of this) {
555 if (test(element)) 555 if (test(element))
556 return element; 556 return element;
557 } 557 }
558 if (orElse !== null) 558 if (orElse !== null)
559 return orElse(); 559 return orElse();
560 throw _internal.IterableElementError.noElement(); 560 throw _internal.IterableElementError.noElement();
561 } 561 }
562 lastWhere(test, opt$) { 562 lastWhere(test, opt$) {
563 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 563 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
564 let result = null; 564 let result = null;
565 let foundMatching = false; 565 let foundMatching = false;
566 for (let element of this) { 566 for (let element of this) {
567 if (test(element)) { 567 if (test(element)) {
568 result = element; 568 result = element;
569 foundMatching = true; 569 foundMatching = true;
570 } 570 }
571 } 571 }
572 if (foundMatching) 572 if (foundMatching)
573 return result; 573 return result;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 return buffer.toString(); 681 return buffer.toString();
682 } 682 }
683 any(f) { 683 any(f) {
684 for (let element of this) { 684 for (let element of this) {
685 if (f(element)) 685 if (f(element))
686 return true; 686 return true;
687 } 687 }
688 return false; 688 return false;
689 } 689 }
690 toList(opt$) { 690 toList(opt$) {
691 let growable = opt$.growable === void 0 ? true : opt$.growable; 691 let growable = opt$ && 'growable' in opt$ ? opt$.growable : true;
692 return new core.List.from(this, {growable: growable}); 692 return new core.List.from(this, {growable: growable});
693 } 693 }
694 toSet() { 694 toSet() {
695 return new core.Set.from(this); 695 return new core.Set.from(this);
696 } 696 }
697 get length() { 697 get length() {
698 dart.assert(!dart.is(this, _internal.EfficientLength)); 698 dart.assert(!dart.is(this, _internal.EfficientLength));
699 let count = 0; 699 let count = 0;
700 let it = this.iterator; 700 let it = this.iterator;
701 while (it.moveNext()) { 701 while (it.moveNext()) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 get single() { 742 get single() {
743 let it = this.iterator; 743 let it = this.iterator;
744 if (!dart.notNull(it.moveNext())) 744 if (!dart.notNull(it.moveNext()))
745 throw _internal.IterableElementError.noElement(); 745 throw _internal.IterableElementError.noElement();
746 let result = dart.as(it.current, E); 746 let result = dart.as(it.current, E);
747 if (it.moveNext()) 747 if (it.moveNext())
748 throw _internal.IterableElementError.tooMany(); 748 throw _internal.IterableElementError.tooMany();
749 return result; 749 return result;
750 } 750 }
751 firstWhere(test, opt$) { 751 firstWhere(test, opt$) {
752 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 752 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
753 for (let element of this) { 753 for (let element of this) {
754 if (test(element)) 754 if (test(element))
755 return element; 755 return element;
756 } 756 }
757 if (orElse !== null) 757 if (orElse !== null)
758 return orElse(); 758 return orElse();
759 throw _internal.IterableElementError.noElement(); 759 throw _internal.IterableElementError.noElement();
760 } 760 }
761 lastWhere(test, opt$) { 761 lastWhere(test, opt$) {
762 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 762 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
763 let result = null; 763 let result = null;
764 let foundMatching = false; 764 let foundMatching = false;
765 for (let element of this) { 765 for (let element of this) {
766 if (test(element)) { 766 if (test(element)) {
767 result = element; 767 result = element;
768 foundMatching = true; 768 foundMatching = true;
769 } 769 }
770 } 770 }
771 if (foundMatching) 771 if (foundMatching)
772 return result; 772 return result;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 } 975 }
976 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; 976 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0;
977 HasNextIterator._NO_NEXT = 1; 977 HasNextIterator._NO_NEXT = 1;
978 HasNextIterator._NOT_MOVED_YET = 2; 978 HasNextIterator._NOT_MOVED_YET = 2;
979 return HasNextIterator; 979 return HasNextIterator;
980 }); 980 });
981 let HasNextIterator = HasNextIterator$(dart.dynamic); 981 let HasNextIterator = HasNextIterator$(dart.dynamic);
982 let LinkedHashMap$ = dart.generic(function(K, V) { 982 let LinkedHashMap$ = dart.generic(function(K, V) {
983 class LinkedHashMap extends core.Object { 983 class LinkedHashMap extends core.Object {
984 LinkedHashMap(opt$) { 984 LinkedHashMap(opt$) {
985 let equals = opt$.equals === void 0 ? null : opt$.equals; 985 let equals = opt$ && 'equals' in opt$ ? opt$.equals : null;
986 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; 986 let hashCode = opt$ && 'hashCode' in opt$ ? opt$.hashCode : null;
987 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; 987 let isValidKey = opt$ && 'isValidKey' in opt$ ? opt$.isValidKey : null;
988 if (isValidKey === null) { 988 if (isValidKey === null) {
989 if (hashCode === null) { 989 if (hashCode === null) {
990 if (equals === null) { 990 if (equals === null) {
991 return new _LinkedHashMap(); 991 return new _LinkedHashMap();
992 } 992 }
993 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 993 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int");
994 } else { 994 } else {
995 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 995 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
996 return new _LinkedIdentityHashMap(); 996 return new _LinkedIdentityHashMap();
997 } 997 }
(...skipping 15 matching lines...) Expand all
1013 return new _LinkedIdentityHashMap(); 1013 return new _LinkedIdentityHashMap();
1014 } 1014 }
1015 LinkedHashMap$from(other) { 1015 LinkedHashMap$from(other) {
1016 let result = new LinkedHashMap(); 1016 let result = new LinkedHashMap();
1017 other.forEach((k, v) => { 1017 other.forEach((k, v) => {
1018 result.set(k, dart.as(v, V)); 1018 result.set(k, dart.as(v, V));
1019 }); 1019 });
1020 return result; 1020 return result;
1021 } 1021 }
1022 LinkedHashMap$fromIterable(iterable, opt$) { 1022 LinkedHashMap$fromIterable(iterable, opt$) {
1023 let key = opt$.key === void 0 ? null : opt$.key; 1023 let key = opt$ && 'key' in opt$ ? opt$.key : null;
1024 let value = opt$.value === void 0 ? null : opt$.value; 1024 let value = opt$ && 'value' in opt$ ? opt$.value : null;
1025 let map = new LinkedHashMap(); 1025 let map = new LinkedHashMap();
1026 Maps._fillMapWithMappedIterable(map, iterable, key, value); 1026 Maps._fillMapWithMappedIterable(map, iterable, key, value);
1027 return map; 1027 return map;
1028 } 1028 }
1029 LinkedHashMap$fromIterables(keys, values) { 1029 LinkedHashMap$fromIterables(keys, values) {
1030 let map = new LinkedHashMap(); 1030 let map = new LinkedHashMap();
1031 Maps._fillMapWithIterables(map, keys, values); 1031 Maps._fillMapWithIterables(map, keys, values);
1032 return map; 1032 return map;
1033 } 1033 }
1034 LinkedHashMap$_literal(keyValuePairs) { 1034 LinkedHashMap$_literal(keyValuePairs) {
1035 return dart.as(_js_helper.fillLiteralMap(keyValuePairs, new _LinkedHashM ap()), LinkedHashMap$(K, V)); 1035 return dart.as(_js_helper.fillLiteralMap(keyValuePairs, new _LinkedHashM ap()), LinkedHashMap$(K, V));
1036 } 1036 }
1037 LinkedHashMap$_empty() { 1037 LinkedHashMap$_empty() {
1038 return new _LinkedHashMap(); 1038 return new _LinkedHashMap();
1039 } 1039 }
1040 } 1040 }
1041 dart.defineNamedConstructor(LinkedHashMap, 'identity'); 1041 dart.defineNamedConstructor(LinkedHashMap, 'identity');
1042 dart.defineNamedConstructor(LinkedHashMap, 'from'); 1042 dart.defineNamedConstructor(LinkedHashMap, 'from');
1043 dart.defineNamedConstructor(LinkedHashMap, 'fromIterable'); 1043 dart.defineNamedConstructor(LinkedHashMap, 'fromIterable');
1044 dart.defineNamedConstructor(LinkedHashMap, 'fromIterables'); 1044 dart.defineNamedConstructor(LinkedHashMap, 'fromIterables');
1045 dart.defineNamedConstructor(LinkedHashMap, '_literal'); 1045 dart.defineNamedConstructor(LinkedHashMap, '_literal');
1046 dart.defineNamedConstructor(LinkedHashMap, '_empty'); 1046 dart.defineNamedConstructor(LinkedHashMap, '_empty');
1047 return LinkedHashMap; 1047 return LinkedHashMap;
1048 }); 1048 });
1049 let LinkedHashMap = LinkedHashMap$(dart.dynamic, dart.dynamic); 1049 let LinkedHashMap = LinkedHashMap$(dart.dynamic, dart.dynamic);
1050 let LinkedHashSet$ = dart.generic(function(E) { 1050 let LinkedHashSet$ = dart.generic(function(E) {
1051 class LinkedHashSet extends core.Object { 1051 class LinkedHashSet extends core.Object {
1052 LinkedHashSet(opt$) { 1052 LinkedHashSet(opt$) {
1053 let equals = opt$.equals === void 0 ? null : opt$.equals; 1053 let equals = opt$ && 'equals' in opt$ ? opt$.equals : null;
1054 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; 1054 let hashCode = opt$ && 'hashCode' in opt$ ? opt$.hashCode : null;
1055 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; 1055 let isValidKey = opt$ && 'isValidKey' in opt$ ? opt$.isValidKey : null;
1056 if (isValidKey === null) { 1056 if (isValidKey === null) {
1057 if (hashCode === null) { 1057 if (hashCode === null) {
1058 if (equals === null) { 1058 if (equals === null) {
1059 return new _LinkedHashSet(); 1059 return new _LinkedHashSet();
1060 } 1060 }
1061 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 1061 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int");
1062 } else { 1062 } else {
1063 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1063 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1064 return new _LinkedIdentityHashSet(); 1064 return new _LinkedIdentityHashSet();
1065 } 1065 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1338 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1339 if (test(this.get(i))) 1339 if (test(this.get(i)))
1340 return true; 1340 return true;
1341 if (length !== this.length) { 1341 if (length !== this.length) {
1342 throw new core.ConcurrentModificationError(this); 1342 throw new core.ConcurrentModificationError(this);
1343 } 1343 }
1344 } 1344 }
1345 return false; 1345 return false;
1346 } 1346 }
1347 firstWhere(test, opt$) { 1347 firstWhere(test, opt$) {
1348 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 1348 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
1349 let length = this.length; 1349 let length = this.length;
1350 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1350 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1351 let element = this.get(i); 1351 let element = this.get(i);
1352 if (test(element)) 1352 if (test(element))
1353 return element; 1353 return element;
1354 if (length !== this.length) { 1354 if (length !== this.length) {
1355 throw new core.ConcurrentModificationError(this); 1355 throw new core.ConcurrentModificationError(this);
1356 } 1356 }
1357 } 1357 }
1358 if (orElse !== null) 1358 if (orElse !== null)
1359 return orElse(); 1359 return orElse();
1360 throw _internal.IterableElementError.noElement(); 1360 throw _internal.IterableElementError.noElement();
1361 } 1361 }
1362 lastWhere(test, opt$) { 1362 lastWhere(test, opt$) {
1363 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 1363 let orElse = opt$ && 'orElse' in opt$ ? opt$.orElse : null;
1364 let length = this.length; 1364 let length = this.length;
1365 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no tNull(i) - 1) { 1365 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no tNull(i) - 1) {
1366 let element = this.get(i); 1366 let element = this.get(i);
1367 if (test(element)) 1367 if (test(element))
1368 return element; 1368 return element;
1369 if (length !== this.length) { 1369 if (length !== this.length) {
1370 throw new core.ConcurrentModificationError(this); 1370 throw new core.ConcurrentModificationError(this);
1371 } 1371 }
1372 } 1372 }
1373 if (orElse !== null) 1373 if (orElse !== null)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 skipWhile(test) { 1443 skipWhile(test) {
1444 return new _internal.SkipWhileIterable(this, test); 1444 return new _internal.SkipWhileIterable(this, test);
1445 } 1445 }
1446 take(count) { 1446 take(count) {
1447 return new _internal.SubListIterable(this, 0, count); 1447 return new _internal.SubListIterable(this, 0, count);
1448 } 1448 }
1449 takeWhile(test) { 1449 takeWhile(test) {
1450 return new _internal.TakeWhileIterable(this, test); 1450 return new _internal.TakeWhileIterable(this, test);
1451 } 1451 }
1452 toList(opt$) { 1452 toList(opt$) {
1453 let growable = opt$.growable === void 0 ? true : opt$.growable; 1453 let growable = opt$ && 'growable' in opt$ ? opt$.growable : true;
1454 let result = null; 1454 let result = null;
1455 if (growable) { 1455 if (growable) {
1456 result = ((_) => { 1456 result = ((_) => {
1457 _.length = this.length; 1457 _.length = this.length;
1458 return _; 1458 return _;
1459 }).bind(this)(new core.List()); 1459 }).bind(this)(new core.List());
1460 } else { 1460 } else {
1461 result = new core.List(this.length); 1461 result = new core.List(this.length);
1462 } 1462 }
1463 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) { 1463 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) {
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2340 throw _internal.IterableElementError.noElement(); 2340 throw _internal.IterableElementError.noElement();
2341 if (dart.notNull(this.length) > 1) 2341 if (dart.notNull(this.length) > 1)
2342 throw _internal.IterableElementError.tooMany(); 2342 throw _internal.IterableElementError.tooMany();
2343 return this[_table].get(this[_head]); 2343 return this[_table].get(this[_head]);
2344 } 2344 }
2345 elementAt(index) { 2345 elementAt(index) {
2346 core.RangeError.checkValidIndex(index, this); 2346 core.RangeError.checkValidIndex(index, this);
2347 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table].length) - 1); 2347 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table].length) - 1);
2348 } 2348 }
2349 toList(opt$) { 2349 toList(opt$) {
2350 let growable = opt$.growable === void 0 ? true : opt$.growable; 2350 let growable = opt$ && 'growable' in opt$ ? opt$.growable : true;
2351 let list = null; 2351 let list = null;
2352 if (growable) { 2352 if (growable) {
2353 list = ((_) => { 2353 list = ((_) => {
2354 _.length = this.length; 2354 _.length = this.length;
2355 return _; 2355 return _;
2356 }).bind(this)(new core.List()); 2356 }).bind(this)(new core.List());
2357 } else { 2357 } else {
2358 list = new core.List(this.length); 2358 list = new core.List(this.length);
2359 } 2359 }
2360 this[_writeToList](list); 2360 this[_writeToList](list);
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 compare = null; 2779 compare = null;
2780 if (isValidKey === void 0) 2780 if (isValidKey === void 0)
2781 isValidKey = null; 2781 isValidKey = null;
2782 let result = new SplayTreeMap(); 2782 let result = new SplayTreeMap();
2783 other.forEach((k, v) => { 2783 other.forEach((k, v) => {
2784 result.set(k, dart.as(v, V)); 2784 result.set(k, dart.as(v, V));
2785 }); 2785 });
2786 return result; 2786 return result;
2787 } 2787 }
2788 SplayTreeMap$fromIterable(iterable, opt$) { 2788 SplayTreeMap$fromIterable(iterable, opt$) {
2789 let key = opt$.key === void 0 ? null : opt$.key; 2789 let key = opt$ && 'key' in opt$ ? opt$.key : null;
2790 let value = opt$.value === void 0 ? null : opt$.value; 2790 let value = opt$ && 'value' in opt$ ? opt$.value : null;
2791 let compare = opt$.compare === void 0 ? null : opt$.compare; 2791 let compare = opt$ && 'compare' in opt$ ? opt$.compare : null;
2792 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; 2792 let isValidKey = opt$ && 'isValidKey' in opt$ ? opt$.isValidKey : null;
2793 let map = new SplayTreeMap(compare, isValidKey); 2793 let map = new SplayTreeMap(compare, isValidKey);
2794 Maps._fillMapWithMappedIterable(map, iterable, key, value); 2794 Maps._fillMapWithMappedIterable(map, iterable, key, value);
2795 return map; 2795 return map;
2796 } 2796 }
2797 SplayTreeMap$fromIterables(keys, values, compare, isValidKey) { 2797 SplayTreeMap$fromIterables(keys, values, compare, isValidKey) {
2798 if (compare === void 0) 2798 if (compare === void 0)
2799 compare = null; 2799 compare = null;
2800 if (isValidKey === void 0) 2800 if (isValidKey === void 0)
2801 isValidKey = null; 2801 isValidKey = null;
2802 let map = new SplayTreeMap(compare, isValidKey); 2802 let map = new SplayTreeMap(compare, isValidKey);
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after
4824 this[_current] = dart.as(this[_cell][_element], E); 4824 this[_current] = dart.as(this[_cell][_element], E);
4825 this[_cell] = this[_cell][_next]; 4825 this[_cell] = this[_cell][_next];
4826 return true; 4826 return true;
4827 } 4827 }
4828 } 4828 }
4829 } 4829 }
4830 return LinkedHashSetIterator; 4830 return LinkedHashSetIterator;
4831 }); 4831 });
4832 let LinkedHashSetIterator = LinkedHashSetIterator$(dart.dynamic); 4832 let LinkedHashSetIterator = LinkedHashSetIterator$(dart.dynamic);
4833 // Exports: 4833 // Exports:
4834 exports.UnmodifiableListView = UnmodifiableListView;
4835 exports.UnmodifiableListView$ = UnmodifiableListView$;
4836 exports.HashMap = HashMap; 4834 exports.HashMap = HashMap;
4837 exports.HashMap$ = HashMap$; 4835 exports.HashMap$ = HashMap$;
4838 exports.SetBase = SetBase; 4836 exports.SetBase = SetBase;
4839 exports.SetBase$ = SetBase$; 4837 exports.SetBase$ = SetBase$;
4840 exports.SetMixin = SetMixin; 4838 exports.SetMixin = SetMixin;
4841 exports.SetMixin$ = SetMixin$; 4839 exports.SetMixin$ = SetMixin$;
4842 exports.HashSet = HashSet; 4840 exports.HashSet = HashSet;
4843 exports.HashSet$ = HashSet$; 4841 exports.HashSet$ = HashSet$;
4844 exports.IterableMixin = IterableMixin; 4842 exports.IterableMixin = IterableMixin;
4845 exports.IterableMixin$ = IterableMixin$; 4843 exports.IterableMixin$ = IterableMixin$;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4890 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 4888 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
4891 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 4889 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
4892 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 4890 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
4893 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 4891 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
4894 exports.HashSetIterator = HashSetIterator; 4892 exports.HashSetIterator = HashSetIterator;
4895 exports.HashSetIterator$ = HashSetIterator$; 4893 exports.HashSetIterator$ = HashSetIterator$;
4896 exports.LinkedHashSetCell = LinkedHashSetCell; 4894 exports.LinkedHashSetCell = LinkedHashSetCell;
4897 exports.LinkedHashSetIterator = LinkedHashSetIterator; 4895 exports.LinkedHashSetIterator = LinkedHashSetIterator;
4898 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 4896 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
4899 })(collection || (collection = {})); 4897 })(collection || (collection = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/convert.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698