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

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

Issue 1554683002: Update to latest analyzer (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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
« 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 dart_library.library('dart/collection', null, /* Imports */[ 1 dart_library.library('dart/collection', null, /* Imports */[
2 "dart/_runtime", 2 "dart/_runtime",
3 'dart/core' 3 'dart/core'
4 ], /* Lazy imports */[ 4 ], /* Lazy imports */[
5 'dart/_internal', 5 'dart/_internal',
6 'dart/_js_helper', 6 'dart/_js_helper',
7 'dart/math' 7 'dart/math'
8 ], function(exports, dart, core, _internal, _js_helper, math) { 8 ], function(exports, dart, core, _internal, _js_helper, math) {
9 'use strict'; 9 'use strict';
10 let dartx = dart.dartx; 10 let dartx = dart.dartx;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 return new (_CustomHashMap$(K, V))(equals, hashCode, isValidKey); 78 return new (_CustomHashMap$(K, V))(equals, hashCode, isValidKey);
79 } 79 }
80 static identity() { 80 static identity() {
81 return new (_IdentityHashMap$(K, V))(); 81 return new (_IdentityHashMap$(K, V))();
82 } 82 }
83 static from(other) { 83 static from(other) {
84 let result = HashMap$(K, V).new(); 84 let result = HashMap$(K, V).new();
85 other.forEach(dart.fn((k, v) => { 85 other.forEach(dart.fn((k, v) => {
86 result.set(dart.as(k, K), dart.as(v, V)); 86 result.set(dart.as(k, K), dart.as(v, V));
87 })); 87 }, dart.void, [dart.dynamic, dart.dynamic]));
88 return result; 88 return result;
89 } 89 }
90 static fromIterable(iterable, opts) { 90 static fromIterable(iterable, opts) {
91 let key = opts && 'key' in opts ? opts.key : null; 91 let key = opts && 'key' in opts ? opts.key : null;
92 let value = opts && 'value' in opts ? opts.value : null; 92 let value = opts && 'value' in opts ? opts.value : null;
93 let map = HashMap$(K, V).new(); 93 let map = HashMap$(K, V).new();
94 Maps._fillMapWithMappedIterable(map, iterable, key, value); 94 Maps._fillMapWithMappedIterable(map, iterable, key, value);
95 return map; 95 return map;
96 } 96 }
97 static fromIterables(keys, values) { 97 static fromIterables(keys, values) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 let value = iterator.current; 237 let value = iterator.current;
238 while (dart.notNull(iterator.moveNext())) { 238 while (dart.notNull(iterator.moveNext())) {
239 value = combine(value, iterator.current); 239 value = combine(value, iterator.current);
240 } 240 }
241 return value; 241 return value;
242 } 242 }
243 fold(initialValue, combine) { 243 fold(initialValue, combine) {
244 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); 244 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
245 let value = initialValue; 245 let value = initialValue;
246 for (let element of this) 246 for (let element of this)
247 value = dart.dcall(combine, value, element); 247 value = combine(value, element);
248 return value; 248 return value;
249 } 249 }
250 every(f) { 250 every(f) {
251 dart.as(f, dart.functionType(core.bool, [E])); 251 dart.as(f, dart.functionType(core.bool, [E]));
252 for (let element of this) { 252 for (let element of this) {
253 if (!dart.notNull(f(element))) return false; 253 if (!dart.notNull(f(element))) return false;
254 } 254 }
255 return true; 255 return true;
256 } 256 }
257 join(separator) { 257 join(separator) {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 let value = iterator.current; 562 let value = iterator.current;
563 while (dart.notNull(iterator.moveNext())) { 563 while (dart.notNull(iterator.moveNext())) {
564 value = combine(value, iterator.current); 564 value = combine(value, iterator.current);
565 } 565 }
566 return value; 566 return value;
567 } 567 }
568 fold(initialValue, combine) { 568 fold(initialValue, combine) {
569 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); 569 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
570 let value = initialValue; 570 let value = initialValue;
571 for (let element of this) 571 for (let element of this)
572 value = dart.dcall(combine, value, element); 572 value = combine(value, element);
573 return value; 573 return value;
574 } 574 }
575 every(f) { 575 every(f) {
576 dart.as(f, dart.functionType(core.bool, [E])); 576 dart.as(f, dart.functionType(core.bool, [E]));
577 for (let element of this) { 577 for (let element of this) {
578 if (!dart.notNull(f(element))) return false; 578 if (!dart.notNull(f(element))) return false;
579 } 579 }
580 return true; 580 return true;
581 } 581 }
582 join(separator) { 582 join(separator) {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 let value = iterator.current; 816 let value = iterator.current;
817 while (dart.notNull(iterator.moveNext())) { 817 while (dart.notNull(iterator.moveNext())) {
818 value = combine(value, iterator.current); 818 value = combine(value, iterator.current);
819 } 819 }
820 return value; 820 return value;
821 } 821 }
822 fold(initialValue, combine) { 822 fold(initialValue, combine) {
823 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); 823 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
824 let value = initialValue; 824 let value = initialValue;
825 for (let element of this) 825 for (let element of this)
826 value = dart.dcall(combine, value, element); 826 value = combine(value, element);
827 return value; 827 return value;
828 } 828 }
829 every(f) { 829 every(f) {
830 dart.as(f, dart.functionType(core.bool, [E])); 830 dart.as(f, dart.functionType(core.bool, [E]));
831 for (let element of this) { 831 for (let element of this) {
832 if (!dart.notNull(f(element))) return false; 832 if (!dart.notNull(f(element))) return false;
833 } 833 }
834 return true; 834 return true;
835 } 835 }
836 join(separator) { 836 join(separator) {
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 } 1241 }
1242 return new (_LinkedCustomHashMap$(K, V))(equals, hashCode, isValidKey); 1242 return new (_LinkedCustomHashMap$(K, V))(equals, hashCode, isValidKey);
1243 } 1243 }
1244 static identity() { 1244 static identity() {
1245 return new (_LinkedIdentityHashMap$(K, V))(); 1245 return new (_LinkedIdentityHashMap$(K, V))();
1246 } 1246 }
1247 static from(other) { 1247 static from(other) {
1248 let result = LinkedHashMap$(K, V).new(); 1248 let result = LinkedHashMap$(K, V).new();
1249 other.forEach(dart.fn((k, v) => { 1249 other.forEach(dart.fn((k, v) => {
1250 result.set(dart.as(k, K), dart.as(v, V)); 1250 result.set(dart.as(k, K), dart.as(v, V));
1251 })); 1251 }, dart.void, [dart.dynamic, dart.dynamic]));
1252 return result; 1252 return result;
1253 } 1253 }
1254 static fromIterable(iterable, opts) { 1254 static fromIterable(iterable, opts) {
1255 let key = opts && 'key' in opts ? opts.key : null; 1255 let key = opts && 'key' in opts ? opts.key : null;
1256 let value = opts && 'value' in opts ? opts.value : null; 1256 let value = opts && 'value' in opts ? opts.value : null;
1257 let map = LinkedHashMap$(K, V).new(); 1257 let map = LinkedHashMap$(K, V).new();
1258 Maps._fillMapWithMappedIterable(map, iterable, key, value); 1258 Maps._fillMapWithMappedIterable(map, iterable, key, value);
1259 return map; 1259 return map;
1260 } 1260 }
1261 static fromIterables(keys, values) { 1261 static fromIterables(keys, values) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 addFirst(entry) { 1360 addFirst(entry) {
1361 dart.as(entry, E); 1361 dart.as(entry, E);
1362 this[_insertAfter](this, entry); 1362 this[_insertAfter](this, entry);
1363 } 1363 }
1364 add(entry) { 1364 add(entry) {
1365 dart.as(entry, E); 1365 dart.as(entry, E);
1366 this[_insertAfter](this[_previous], entry); 1366 this[_insertAfter](this[_previous], entry);
1367 } 1367 }
1368 addAll(entries) { 1368 addAll(entries) {
1369 dart.as(entries, core.Iterable$(E)); 1369 dart.as(entries, core.Iterable$(E));
1370 entries[dartx.forEach](dart.fn((entry => this[_insertAfter](this[_previo us], dart.as(entry, E))).bind(this), dart.void, [dart.dynamic])); 1370 entries[dartx.forEach](dart.fn((entry => this[_insertAfter](this[_previo us], entry)).bind(this), dart.void, [E]));
1371 } 1371 }
1372 remove(entry) { 1372 remove(entry) {
1373 dart.as(entry, E); 1373 dart.as(entry, E);
1374 if (!dart.equals(entry[_list], this)) return false; 1374 if (!dart.equals(entry[_list], this)) return false;
1375 this[_unlink](entry); 1375 this[_unlink](entry);
1376 return true; 1376 return true;
1377 } 1377 }
1378 get iterator() { 1378 get iterator() {
1379 return new (_LinkedListIterator$(E))(this); 1379 return new (_LinkedListIterator$(E))(this);
1380 } 1380 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 let buffer = new core.StringBuffer(); 1688 let buffer = new core.StringBuffer();
1689 buffer.writeAll(this, separator); 1689 buffer.writeAll(this, separator);
1690 return dart.toString(buffer); 1690 return dart.toString(buffer);
1691 } 1691 }
1692 where(test) { 1692 where(test) {
1693 dart.as(test, dart.functionType(core.bool, [E])); 1693 dart.as(test, dart.functionType(core.bool, [E]));
1694 return new (_internal.WhereIterable$(E))(this, test); 1694 return new (_internal.WhereIterable$(E))(this, test);
1695 } 1695 }
1696 map(f) { 1696 map(f) {
1697 dart.as(f, dart.functionType(dart.dynamic, [E])); 1697 dart.as(f, dart.functionType(dart.dynamic, [E]));
1698 return new _internal.MappedListIterable(this, f); 1698 return new (_internal.MappedListIterable$(E, dart.dynamic))(this, f);
1699 } 1699 }
1700 expand(f) { 1700 expand(f) {
1701 dart.as(f, dart.functionType(core.Iterable, [E])); 1701 dart.as(f, dart.functionType(core.Iterable, [E]));
1702 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); 1702 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f);
1703 } 1703 }
1704 reduce(combine) { 1704 reduce(combine) {
1705 dart.as(combine, dart.functionType(E, [E, E])); 1705 dart.as(combine, dart.functionType(E, [E, E]));
1706 let length = this.length; 1706 let length = this.length;
1707 if (length == 0) dart.throw(_internal.IterableElementError.noElement()); 1707 if (length == 0) dart.throw(_internal.IterableElementError.noElement());
1708 let value = this.get(0); 1708 let value = this.get(0);
1709 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1709 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1710 value = combine(value, this.get(i)); 1710 value = combine(value, this.get(i));
1711 if (length != this.length) { 1711 if (length != this.length) {
1712 dart.throw(new core.ConcurrentModificationError(this)); 1712 dart.throw(new core.ConcurrentModificationError(this));
1713 } 1713 }
1714 } 1714 }
1715 return value; 1715 return value;
1716 } 1716 }
1717 fold(initialValue, combine) { 1717 fold(initialValue, combine) {
1718 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); 1718 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
1719 let value = initialValue; 1719 let value = initialValue;
1720 let length = this.length; 1720 let length = this.length;
1721 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1721 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1722 value = dart.dcall(combine, value, this.get(i)); 1722 value = combine(value, this.get(i));
1723 if (length != this.length) { 1723 if (length != this.length) {
1724 dart.throw(new core.ConcurrentModificationError(this)); 1724 dart.throw(new core.ConcurrentModificationError(this));
1725 } 1725 }
1726 } 1726 }
1727 return value; 1727 return value;
1728 } 1728 }
1729 skip(count) { 1729 skip(count) {
1730 return new (_internal.SubListIterable$(E))(this, count, null); 1730 return new (_internal.SubListIterable$(E))(this, count, null);
1731 } 1731 }
1732 skipWhile(test) { 1732 skipWhile(test) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 if (this[dartx.length] == 0) { 1822 if (this[dartx.length] == 0) {
1823 dart.throw(_internal.IterableElementError.noElement()); 1823 dart.throw(_internal.IterableElementError.noElement());
1824 } 1824 }
1825 let result = this.get(dart.notNull(this[dartx.length]) - 1); 1825 let result = this.get(dart.notNull(this[dartx.length]) - 1);
1826 this[dartx.length] = dart.notNull(this[dartx.length]) - 1; 1826 this[dartx.length] = dart.notNull(this[dartx.length]) - 1;
1827 return result; 1827 return result;
1828 } 1828 }
1829 sort(compare) { 1829 sort(compare) {
1830 if (compare === void 0) compare = null; 1830 if (compare === void 0) compare = null;
1831 dart.as(compare, dart.functionType(core.int, [E, E])); 1831 dart.as(compare, dart.functionType(core.int, [E, E]));
1832 _internal.Sort.sort(this, compare == null ? core.Comparable.compare : co mpare); 1832 _internal.Sort.sort(this, dart.as(compare == null ? core.Comparable.comp are : compare, __CastType0));
1833 } 1833 }
1834 shuffle(random) { 1834 shuffle(random) {
1835 if (random === void 0) random = null; 1835 if (random === void 0) random = null;
1836 if (random == null) random = math.Random.new(); 1836 if (random == null) random = math.Random.new();
1837 let length = this.length; 1837 let length = this.length;
1838 while (dart.notNull(length) > 1) { 1838 while (dart.notNull(length) > 1) {
1839 let pos = random.nextInt(length); 1839 let pos = random.nextInt(length);
1840 length = dart.notNull(length) - 1; 1840 length = dart.notNull(length) - 1;
1841 let tmp = this.get(length); 1841 let tmp = this.get(length);
1842 this.set(length, this.get(pos)); 1842 this.set(length, this.get(pos));
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 return IterableBase.iterableToFullString(list, '[', ']'); 2125 return IterableBase.iterableToFullString(list, '[', ']');
2126 } 2126 }
2127 } 2127 }
2128 dart.setSignature(ListBase, { 2128 dart.setSignature(ListBase, {
2129 statics: () => ({listToString: [core.String, [core.List]]}), 2129 statics: () => ({listToString: [core.String, [core.List]]}),
2130 names: ['listToString'] 2130 names: ['listToString']
2131 }); 2131 });
2132 return ListBase; 2132 return ListBase;
2133 }); 2133 });
2134 let ListBase = ListBase$(); 2134 let ListBase = ListBase$();
2135 const __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.i nt, [dart.dynamic, dart.dynamic]));
2135 const MapMixin$ = dart.generic(function(K, V) { 2136 const MapMixin$ = dart.generic(function(K, V) {
2136 class MapMixin extends core.Object { 2137 class MapMixin extends core.Object {
2137 forEach(action) { 2138 forEach(action) {
2138 dart.as(action, dart.functionType(dart.void, [K, V])); 2139 dart.as(action, dart.functionType(dart.void, [K, V]));
2139 for (let key of this.keys) { 2140 for (let key of this.keys) {
2140 action(key, this.get(key)); 2141 action(key, this.get(key));
2141 } 2142 }
2142 } 2143 }
2143 addAll(other) { 2144 addAll(other) {
2144 dart.as(other, core.Map$(K, V)); 2145 dart.as(other, core.Map$(K, V));
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 result.write('{'); 2459 result.write('{');
2459 let first = true; 2460 let first = true;
2460 m.forEach(dart.fn((k, v) => { 2461 m.forEach(dart.fn((k, v) => {
2461 if (!dart.notNull(first)) { 2462 if (!dart.notNull(first)) {
2462 result.write(', '); 2463 result.write(', ');
2463 } 2464 }
2464 first = false; 2465 first = false;
2465 result.write(k); 2466 result.write(k);
2466 result.write(': '); 2467 result.write(': ');
2467 result.write(v); 2468 result.write(v);
2468 })); 2469 }, dart.void, [dart.dynamic, dart.dynamic]));
2469 result.write('}'); 2470 result.write('}');
2470 } finally { 2471 } finally {
2471 dart.assert(core.identical(IterableBase._toStringVisiting[dartx.last], m )); 2472 dart.assert(core.identical(IterableBase._toStringVisiting[dartx.last], m ));
2472 IterableBase._toStringVisiting[dartx.removeLast](); 2473 IterableBase._toStringVisiting[dartx.removeLast]();
2473 } 2474 }
2474 return dart.toString(result); 2475 return dart.toString(result);
2475 } 2476 }
2476 static _id(x) { 2477 static _id(x) {
2477 return x; 2478 return x;
2478 } 2479 }
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
3381 }); 3382 });
3382 let _SplayTree = _SplayTree$(); 3383 let _SplayTree = _SplayTree$();
3383 const _comparator = Symbol('_comparator'); 3384 const _comparator = Symbol('_comparator');
3384 const _validKey = Symbol('_validKey'); 3385 const _validKey = Symbol('_validKey');
3385 const SplayTreeMap$ = dart.generic(function(K, V) { 3386 const SplayTreeMap$ = dart.generic(function(K, V) {
3386 class SplayTreeMap extends _SplayTree$(K) { 3387 class SplayTreeMap extends _SplayTree$(K) {
3387 SplayTreeMap(compare, isValidKey) { 3388 SplayTreeMap(compare, isValidKey) {
3388 if (compare === void 0) compare = null; 3389 if (compare === void 0) compare = null;
3389 if (isValidKey === void 0) isValidKey = null; 3390 if (isValidKey === void 0) isValidKey = null;
3390 this[_comparator] = dart.as(compare == null ? core.Comparable.compare : compare, core.Comparator$(K)); 3391 this[_comparator] = dart.as(compare == null ? core.Comparable.compare : compare, core.Comparator$(K));
3391 this[_validKey] = isValidKey != null ? isValidKey : dart.fn(v => dart.is (v, K), core.bool, [dart.dynamic]); 3392 this[_validKey] = dart.as(isValidKey != null ? isValidKey : dart.fn(v => dart.is(v, K), core.bool, [core.Object]), _Predicate$(core.Object));
3392 super._SplayTree(); 3393 super._SplayTree();
3393 } 3394 }
3394 static from(other, compare, isValidKey) { 3395 static from(other, compare, isValidKey) {
3395 if (compare === void 0) compare = null; 3396 if (compare === void 0) compare = null;
3396 if (isValidKey === void 0) isValidKey = null; 3397 if (isValidKey === void 0) isValidKey = null;
3397 let result = new (SplayTreeMap$(K, V))(); 3398 let result = new (SplayTreeMap$(K, V))();
3398 other.forEach(dart.fn((k, v) => { 3399 other.forEach(dart.fn((k, v) => {
3399 result.set(dart.as(k, K), dart.as(v, V)); 3400 result.set(dart.as(k, K), dart.as(v, V));
3400 })); 3401 }, dart.void, [dart.dynamic, dart.dynamic]));
3401 return result; 3402 return result;
3402 } 3403 }
3403 static fromIterable(iterable, opts) { 3404 static fromIterable(iterable, opts) {
3404 let key = opts && 'key' in opts ? opts.key : null; 3405 let key = opts && 'key' in opts ? opts.key : null;
3405 let value = opts && 'value' in opts ? opts.value : null; 3406 let value = opts && 'value' in opts ? opts.value : null;
3406 let compare = opts && 'compare' in opts ? opts.compare : null; 3407 let compare = opts && 'compare' in opts ? opts.compare : null;
3407 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 3408 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
3408 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); 3409 let map = new (SplayTreeMap$(K, V))(compare, isValidKey);
3409 Maps._fillMapWithMappedIterable(map, iterable, key, value); 3410 Maps._fillMapWithMappedIterable(map, iterable, key, value);
3410 return map; 3411 return map;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
3480 } 3481 }
3481 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp); 3482 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp);
3482 return value; 3483 return value;
3483 } 3484 }
3484 addAll(other) { 3485 addAll(other) {
3485 dart.as(other, core.Map$(K, V)); 3486 dart.as(other, core.Map$(K, V));
3486 other.forEach(dart.fn(((key, value) => { 3487 other.forEach(dart.fn(((key, value) => {
3487 dart.as(key, K); 3488 dart.as(key, K);
3488 dart.as(value, V); 3489 dart.as(value, V);
3489 this.set(key, value); 3490 this.set(key, value);
3490 }).bind(this), dart.dynamic, [K, V])); 3491 }).bind(this), dart.void, [K, V]));
3491 } 3492 }
3492 get isEmpty() { 3493 get isEmpty() {
3493 return this[_root] == null; 3494 return this[_root] == null;
3494 } 3495 }
3495 get isNotEmpty() { 3496 get isNotEmpty() {
3496 return !dart.notNull(this.isEmpty); 3497 return !dart.notNull(this.isEmpty);
3497 } 3498 }
3498 forEach(f) { 3499 forEach(f) {
3499 dart.as(f, dart.functionType(dart.void, [K, V])); 3500 dart.as(f, dart.functionType(dart.void, [K, V]));
3500 let nodes = new (_SplayTreeNodeIterator$(K))(this); 3501 let nodes = new (_SplayTreeNodeIterator$(K))(this);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
3799 return _SplayTreeNodeIterator; 3800 return _SplayTreeNodeIterator;
3800 }); 3801 });
3801 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(); 3802 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$();
3802 const _clone = Symbol('_clone'); 3803 const _clone = Symbol('_clone');
3803 const SplayTreeSet$ = dart.generic(function(E) { 3804 const SplayTreeSet$ = dart.generic(function(E) {
3804 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set Mixin$(E)) { 3805 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set Mixin$(E)) {
3805 SplayTreeSet(compare, isValidKey) { 3806 SplayTreeSet(compare, isValidKey) {
3806 if (compare === void 0) compare = null; 3807 if (compare === void 0) compare = null;
3807 if (isValidKey === void 0) isValidKey = null; 3808 if (isValidKey === void 0) isValidKey = null;
3808 this[_comparator] = dart.as(compare == null ? core.Comparable.compare : compare, core.Comparator$(E)); 3809 this[_comparator] = dart.as(compare == null ? core.Comparable.compare : compare, core.Comparator$(E));
3809 this[_validKey] = isValidKey != null ? isValidKey : dart.fn(v => dart.is (v, E), core.bool, [dart.dynamic]); 3810 this[_validKey] = dart.as(isValidKey != null ? isValidKey : dart.fn(v => dart.is(v, E), core.bool, [core.Object]), _Predicate$(core.Object));
3810 super._SplayTree(); 3811 super._SplayTree();
3811 } 3812 }
3812 static from(elements, compare, isValidKey) { 3813 static from(elements, compare, isValidKey) {
3813 if (compare === void 0) compare = null; 3814 if (compare === void 0) compare = null;
3814 if (isValidKey === void 0) isValidKey = null; 3815 if (isValidKey === void 0) isValidKey = null;
3815 let result = new (SplayTreeSet$(E))(compare, isValidKey); 3816 let result = new (SplayTreeSet$(E))(compare, isValidKey);
3816 for (let element of dart.as(elements, core.Iterable$(E))) { 3817 for (let element of dart.as(elements, core.Iterable$(E))) {
3817 result.add(element); 3818 result.add(element);
3818 } 3819 }
3819 return result; 3820 return result;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4002 get isEmpty() { 4003 get isEmpty() {
4003 return this[_length] == 0; 4004 return this[_length] == 0;
4004 } 4005 }
4005 get isNotEmpty() { 4006 get isNotEmpty() {
4006 return !dart.notNull(this.isEmpty); 4007 return !dart.notNull(this.isEmpty);
4007 } 4008 }
4008 get keys() { 4009 get keys() {
4009 return new (HashMapKeyIterable$(K))(this); 4010 return new (HashMapKeyIterable$(K))(this);
4010 } 4011 }
4011 get values() { 4012 get values() {
4012 return _internal.MappedIterable$(K, V).new(this.keys, dart.fn((each => t his.get(each)).bind(this), V, [dart.dynamic])); 4013 return _internal.MappedIterable$(K, V).new(this.keys, dart.fn((each => t his.get(each)).bind(this), V, [K]));
4013 } 4014 }
4014 containsKey(key) { 4015 containsKey(key) {
4015 if (dart.notNull(_HashMap$()._isStringKey(key))) { 4016 if (dart.notNull(_HashMap$()._isStringKey(key))) {
4016 let strings = this[_strings]; 4017 let strings = this[_strings];
4017 return strings == null ? false : _HashMap$()._hasTableEntry(strings, k ey); 4018 return strings == null ? false : _HashMap$()._hasTableEntry(strings, k ey);
4018 } else if (dart.notNull(_HashMap$()._isNumericKey(key))) { 4019 } else if (dart.notNull(_HashMap$()._isNumericKey(key))) {
4019 let nums = this[_nums]; 4020 let nums = this[_nums];
4020 return nums == null ? false : _HashMap$()._hasTableEntry(nums, key); 4021 return nums == null ? false : _HashMap$()._hasTableEntry(nums, key);
4021 } else { 4022 } else {
4022 return this[_containsKey](key); 4023 return this[_containsKey](key);
4023 } 4024 }
4024 } 4025 }
4025 [_containsKey](key) { 4026 [_containsKey](key) {
4026 let rest = this[_rest]; 4027 let rest = this[_rest];
4027 if (rest == null) return false; 4028 if (rest == null) return false;
4028 let bucket = this[_getBucket](rest, key); 4029 let bucket = this[_getBucket](rest, key);
4029 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 4030 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
4030 } 4031 }
4031 containsValue(value) { 4032 containsValue(value) {
4032 return this[_computeKeys]()[dartx.any](dart.fn((each => dart.equals(this .get(each), value)).bind(this), core.bool, [dart.dynamic])); 4033 return this[_computeKeys]()[dartx.any](dart.fn((each => dart.equals(this .get(each), value)).bind(this), core.bool, [dart.dynamic]));
4033 } 4034 }
4034 addAll(other) { 4035 addAll(other) {
4035 dart.as(other, core.Map$(K, V)); 4036 dart.as(other, core.Map$(K, V));
4036 other.forEach(dart.fn(((key, value) => { 4037 other.forEach(dart.fn(((key, value) => {
4037 dart.as(key, K); 4038 dart.as(key, K);
4038 dart.as(value, V); 4039 dart.as(value, V);
4039 this.set(key, value); 4040 this.set(key, value);
4040 }).bind(this), dart.dynamic, [K, V])); 4041 }).bind(this), dart.void, [K, V]));
4041 } 4042 }
4042 get(key) { 4043 get(key) {
4043 if (dart.notNull(_HashMap$()._isStringKey(key))) { 4044 if (dart.notNull(_HashMap$()._isStringKey(key))) {
4044 let strings = this[_strings]; 4045 let strings = this[_strings];
4045 return strings == null ? null : dart.as(_HashMap$()._getTableEntry(str ings, key), V); 4046 return dart.as(strings == null ? null : _HashMap$()._getTableEntry(str ings, key), V);
4046 } else if (dart.notNull(_HashMap$()._isNumericKey(key))) { 4047 } else if (dart.notNull(_HashMap$()._isNumericKey(key))) {
4047 let nums = this[_nums]; 4048 let nums = this[_nums];
4048 return nums == null ? null : dart.as(_HashMap$()._getTableEntry(nums, key), V); 4049 return dart.as(nums == null ? null : _HashMap$()._getTableEntry(nums, key), V);
4049 } else { 4050 } else {
4050 return this[_get](key); 4051 return this[_get](key);
4051 } 4052 }
4052 } 4053 }
4053 [_get](key) { 4054 [_get](key) {
4054 let rest = this[_rest]; 4055 let rest = this[_rest];
4055 if (rest == null) return null; 4056 if (rest == null) return null;
4056 let bucket = this[_getBucket](rest, key); 4057 let bucket = this[_getBucket](rest, key);
4057 let index = this[_findBucketIndex](bucket, key); 4058 let index = this[_findBucketIndex](bucket, key);
4058 return dart.notNull(index) < 0 ? null : dart.as(bucket[dart.notNull(inde x) + 1], V); 4059 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde x) + 1], V);
4059 } 4060 }
4060 set(key, value) { 4061 set(key, value) {
4061 dart.as(key, K); 4062 dart.as(key, K);
4062 dart.as(value, V); 4063 dart.as(value, V);
4063 if (dart.notNull(_HashMap$()._isStringKey(key))) { 4064 if (dart.notNull(_HashMap$()._isStringKey(key))) {
4064 let strings = this[_strings]; 4065 let strings = this[_strings];
4065 if (strings == null) this[_strings] = strings = _HashMap$()._newHashTa ble(); 4066 if (strings == null) this[_strings] = strings = _HashMap$()._newHashTa ble();
4066 this[_addHashTableEntry](strings, key, value); 4067 this[_addHashTableEntry](strings, key, value);
4067 } else if (dart.notNull(_HashMap$()._isNumericKey(key))) { 4068 } else if (dart.notNull(_HashMap$()._isNumericKey(key))) {
4068 let nums = this[_nums]; 4069 let nums = this[_nums];
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
4306 return _IdentityHashMap; 4307 return _IdentityHashMap;
4307 }); 4308 });
4308 let _IdentityHashMap = _IdentityHashMap$(); 4309 let _IdentityHashMap = _IdentityHashMap$();
4309 const _equals = Symbol('_equals'); 4310 const _equals = Symbol('_equals');
4310 const _hashCode = Symbol('_hashCode'); 4311 const _hashCode = Symbol('_hashCode');
4311 const _CustomHashMap$ = dart.generic(function(K, V) { 4312 const _CustomHashMap$ = dart.generic(function(K, V) {
4312 class _CustomHashMap extends _HashMap$(K, V) { 4313 class _CustomHashMap extends _HashMap$(K, V) {
4313 _CustomHashMap(equals, hashCode, validKey) { 4314 _CustomHashMap(equals, hashCode, validKey) {
4314 this[_equals] = equals; 4315 this[_equals] = equals;
4315 this[_hashCode] = hashCode; 4316 this[_hashCode] = hashCode;
4316 this[_validKey] = validKey != null ? validKey : dart.fn(v => dart.is(v, K), core.bool, [dart.dynamic]); 4317 this[_validKey] = dart.as(validKey != null ? validKey : dart.fn(v => dar t.is(v, K), core.bool, [core.Object]), _Predicate$(core.Object));
4317 super._HashMap(); 4318 super._HashMap();
4318 } 4319 }
4319 get(key) { 4320 get(key) {
4320 if (!dart.notNull(this[_validKey](key))) return null; 4321 if (!dart.notNull(this[_validKey](key))) return null;
4321 return super[_get](key); 4322 return super[_get](key);
4322 } 4323 }
4323 set(key, value) { 4324 set(key, value) {
4324 dart.as(key, K); 4325 dart.as(key, K);
4325 dart.as(value, V); 4326 dart.as(value, V);
4326 super[_set](key, value); 4327 super[_set](key, value);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
4462 get isEmpty() { 4463 get isEmpty() {
4463 return this[_length] == 0; 4464 return this[_length] == 0;
4464 } 4465 }
4465 get isNotEmpty() { 4466 get isNotEmpty() {
4466 return !dart.notNull(this.isEmpty); 4467 return !dart.notNull(this.isEmpty);
4467 } 4468 }
4468 get keys() { 4469 get keys() {
4469 return new (LinkedHashMapKeyIterable$(K))(this); 4470 return new (LinkedHashMapKeyIterable$(K))(this);
4470 } 4471 }
4471 get values() { 4472 get values() {
4472 return _internal.MappedIterable$(K, V).new(this.keys, dart.fn((each => t his.get(each)).bind(this), V, [dart.dynamic])); 4473 return _internal.MappedIterable$(K, V).new(this.keys, dart.fn((each => t his.get(each)).bind(this), V, [K]));
4473 } 4474 }
4474 containsKey(key) { 4475 containsKey(key) {
4475 if (dart.notNull(_LinkedHashMap$()._isStringKey(key))) { 4476 if (dart.notNull(_LinkedHashMap$()._isStringKey(key))) {
4476 let strings = this[_strings]; 4477 let strings = this[_strings];
4477 if (strings == null) return false; 4478 if (strings == null) return false;
4478 let cell = dart.as(_LinkedHashMap$()._getTableEntry(strings, key), Lin kedHashMapCell); 4479 let cell = dart.as(_LinkedHashMap$()._getTableEntry(strings, key), Lin kedHashMapCell);
4479 return cell != null; 4480 return cell != null;
4480 } else if (dart.notNull(_LinkedHashMap$()._isNumericKey(key))) { 4481 } else if (dart.notNull(_LinkedHashMap$()._isNumericKey(key))) {
4481 let nums = this[_nums]; 4482 let nums = this[_nums];
4482 if (nums == null) return false; 4483 if (nums == null) return false;
4483 let cell = dart.as(_LinkedHashMap$()._getTableEntry(nums, key), Linked HashMapCell); 4484 let cell = dart.as(_LinkedHashMap$()._getTableEntry(nums, key), Linked HashMapCell);
4484 return cell != null; 4485 return cell != null;
4485 } else { 4486 } else {
4486 return this[_containsKey](key); 4487 return this[_containsKey](key);
4487 } 4488 }
4488 } 4489 }
4489 [_containsKey](key) { 4490 [_containsKey](key) {
4490 let rest = this[_rest]; 4491 let rest = this[_rest];
4491 if (rest == null) return false; 4492 if (rest == null) return false;
4492 let bucket = this[_getBucket](rest, key); 4493 let bucket = this[_getBucket](rest, key);
4493 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 4494 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
4494 } 4495 }
4495 containsValue(value) { 4496 containsValue(value) {
4496 return this.keys[dartx.any](dart.fn((each => dart.equals(this.get(each), value)).bind(this), core.bool, [dart.dynamic])); 4497 return this.keys[dartx.any](dart.fn((each => dart.equals(this.get(each), value)).bind(this), core.bool, [K]));
4497 } 4498 }
4498 addAll(other) { 4499 addAll(other) {
4499 dart.as(other, core.Map$(K, V)); 4500 dart.as(other, core.Map$(K, V));
4500 other.forEach(dart.fn(((key, value) => { 4501 other.forEach(dart.fn(((key, value) => {
4501 dart.as(key, K); 4502 dart.as(key, K);
4502 dart.as(value, V); 4503 dart.as(value, V);
4503 this.set(key, value); 4504 this.set(key, value);
4504 }).bind(this), dart.dynamic, [K, V])); 4505 }).bind(this), dart.void, [K, V]));
4505 } 4506 }
4506 get(key) { 4507 get(key) {
4507 if (dart.notNull(_LinkedHashMap$()._isStringKey(key))) { 4508 if (dart.notNull(_LinkedHashMap$()._isStringKey(key))) {
4508 let strings = this[_strings]; 4509 let strings = this[_strings];
4509 if (strings == null) return null; 4510 if (strings == null) return null;
4510 let cell = dart.as(_LinkedHashMap$()._getTableEntry(strings, key), Lin kedHashMapCell); 4511 let cell = dart.as(_LinkedHashMap$()._getTableEntry(strings, key), Lin kedHashMapCell);
4511 return cell == null ? null : dart.as(cell[_value], V); 4512 return dart.as(cell == null ? null : cell[_value], V);
4512 } else if (dart.notNull(_LinkedHashMap$()._isNumericKey(key))) { 4513 } else if (dart.notNull(_LinkedHashMap$()._isNumericKey(key))) {
4513 let nums = this[_nums]; 4514 let nums = this[_nums];
4514 if (nums == null) return null; 4515 if (nums == null) return null;
4515 let cell = dart.as(_LinkedHashMap$()._getTableEntry(nums, key), Linked HashMapCell); 4516 let cell = dart.as(_LinkedHashMap$()._getTableEntry(nums, key), Linked HashMapCell);
4516 return cell == null ? null : dart.as(cell[_value], V); 4517 return dart.as(cell == null ? null : cell[_value], V);
4517 } else { 4518 } else {
4518 return this[_get](key); 4519 return this[_get](key);
4519 } 4520 }
4520 } 4521 }
4521 [_get](key) { 4522 [_get](key) {
4522 let rest = this[_rest]; 4523 let rest = this[_rest];
4523 if (rest == null) return null; 4524 if (rest == null) return null;
4524 let bucket = this[_getBucket](rest, key); 4525 let bucket = this[_getBucket](rest, key);
4525 let index = this[_findBucketIndex](bucket, key); 4526 let index = this[_findBucketIndex](bucket, key);
4526 if (dart.notNull(index) < 0) return null; 4527 if (dart.notNull(index) < 0) return null;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
4765 } 4766 }
4766 } 4767 }
4767 return _LinkedIdentityHashMap; 4768 return _LinkedIdentityHashMap;
4768 }); 4769 });
4769 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(); 4770 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$();
4770 const _LinkedCustomHashMap$ = dart.generic(function(K, V) { 4771 const _LinkedCustomHashMap$ = dart.generic(function(K, V) {
4771 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { 4772 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) {
4772 _LinkedCustomHashMap(equals, hashCode, validKey) { 4773 _LinkedCustomHashMap(equals, hashCode, validKey) {
4773 this[_equals] = equals; 4774 this[_equals] = equals;
4774 this[_hashCode] = hashCode; 4775 this[_hashCode] = hashCode;
4775 this[_validKey] = validKey != null ? validKey : dart.fn(v => dart.is(v, K), core.bool, [dart.dynamic]); 4776 this[_validKey] = dart.as(validKey != null ? validKey : dart.fn(v => dar t.is(v, K), core.bool, [core.Object]), _Predicate$(core.Object));
4776 super._LinkedHashMap(); 4777 super._LinkedHashMap();
4777 } 4778 }
4778 get(key) { 4779 get(key) {
4779 if (!dart.notNull(this[_validKey](key))) return null; 4780 if (!dart.notNull(this[_validKey](key))) return null;
4780 return super[_get](key); 4781 return super[_get](key);
4781 } 4782 }
4782 set(key, value) { 4783 set(key, value) {
4783 dart.as(key, K); 4784 dart.as(key, K);
4784 dart.as(value, V); 4785 dart.as(value, V);
4785 super[_set](key, value); 4786 super[_set](key, value);
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
5196 return _IdentityHashSet; 5197 return _IdentityHashSet;
5197 }); 5198 });
5198 let _IdentityHashSet = _IdentityHashSet$(); 5199 let _IdentityHashSet = _IdentityHashSet$();
5199 const _equality = Symbol('_equality'); 5200 const _equality = Symbol('_equality');
5200 const _hasher = Symbol('_hasher'); 5201 const _hasher = Symbol('_hasher');
5201 const _CustomHashSet$ = dart.generic(function(E) { 5202 const _CustomHashSet$ = dart.generic(function(E) {
5202 class _CustomHashSet extends _HashSet$(E) { 5203 class _CustomHashSet extends _HashSet$(E) {
5203 _CustomHashSet(equality, hasher, validKey) { 5204 _CustomHashSet(equality, hasher, validKey) {
5204 this[_equality] = equality; 5205 this[_equality] = equality;
5205 this[_hasher] = hasher; 5206 this[_hasher] = hasher;
5206 this[_validKey] = validKey != null ? validKey : dart.fn(x => dart.is(x, E), core.bool, [dart.dynamic]); 5207 this[_validKey] = dart.as(validKey != null ? validKey : dart.fn(x => dar t.is(x, E), core.bool, [core.Object]), _Predicate$(core.Object));
5207 super._HashSet(); 5208 super._HashSet();
5208 } 5209 }
5209 [_newSet]() { 5210 [_newSet]() {
5210 return new (_CustomHashSet$(E))(this[_equality], this[_hasher], this[_va lidKey]); 5211 return new (_CustomHashSet$(E))(this[_equality], this[_hasher], this[_va lidKey]);
5211 } 5212 }
5212 [_findBucketIndex](bucket, element) { 5213 [_findBucketIndex](bucket, element) {
5213 if (bucket == null) return -1; 5214 if (bucket == null) return -1;
5214 let length = bucket.length; 5215 let length = bucket.length;
5215 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 5216 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
5216 if (dart.notNull(this[_equality](dart.as(bucket[i], E), dart.as(elemen t, E)))) return i; 5217 if (dart.notNull(this[_equality](dart.as(bucket[i], E), dart.as(elemen t, E)))) return i;
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
5614 methods: () => ({[_newSet]: [core.Set$(E), []]}) 5615 methods: () => ({[_newSet]: [core.Set$(E), []]})
5615 }); 5616 });
5616 return _LinkedIdentityHashSet; 5617 return _LinkedIdentityHashSet;
5617 }); 5618 });
5618 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(); 5619 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$();
5619 const _LinkedCustomHashSet$ = dart.generic(function(E) { 5620 const _LinkedCustomHashSet$ = dart.generic(function(E) {
5620 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { 5621 class _LinkedCustomHashSet extends _LinkedHashSet$(E) {
5621 _LinkedCustomHashSet(equality, hasher, validKey) { 5622 _LinkedCustomHashSet(equality, hasher, validKey) {
5622 this[_equality] = equality; 5623 this[_equality] = equality;
5623 this[_hasher] = hasher; 5624 this[_hasher] = hasher;
5624 this[_validKey] = validKey != null ? validKey : dart.fn(x => dart.is(x, E), core.bool, [dart.dynamic]); 5625 this[_validKey] = dart.as(validKey != null ? validKey : dart.fn(x => dar t.is(x, E), core.bool, [core.Object]), _Predicate$(core.Object));
5625 super._LinkedHashSet(); 5626 super._LinkedHashSet();
5626 } 5627 }
5627 [_newSet]() { 5628 [_newSet]() {
5628 return new (_LinkedCustomHashSet$(E))(this[_equality], this[_hasher], th is[_validKey]); 5629 return new (_LinkedCustomHashSet$(E))(this[_equality], this[_hasher], th is[_validKey]);
5629 } 5630 }
5630 [_findBucketIndex](bucket, element) { 5631 [_findBucketIndex](bucket, element) {
5631 if (bucket == null) return -1; 5632 if (bucket == null) return -1;
5632 let length = bucket.length; 5633 let length = bucket.length;
5633 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 5634 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
5634 let cell = dart.as(bucket[i], LinkedHashSetCell); 5635 let cell = dart.as(bucket[i], LinkedHashSetCell);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
5783 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 5784 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
5784 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 5785 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
5785 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 5786 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
5786 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 5787 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
5787 exports.HashSetIterator$ = HashSetIterator$; 5788 exports.HashSetIterator$ = HashSetIterator$;
5788 exports.HashSetIterator = HashSetIterator; 5789 exports.HashSetIterator = HashSetIterator;
5789 exports.LinkedHashSetCell = LinkedHashSetCell; 5790 exports.LinkedHashSetCell = LinkedHashSetCell;
5790 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 5791 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
5791 exports.LinkedHashSetIterator = LinkedHashSetIterator; 5792 exports.LinkedHashSetIterator = LinkedHashSetIterator;
5792 }); 5793 });
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