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

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

Issue 1752193002: Add a few more known non-null cases (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 let equals = opts && 'equals' in opts ? opts.equals : null; 53 let equals = opts && 'equals' in opts ? opts.equals : null;
54 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 54 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
55 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 55 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
56 if (isValidKey == null) { 56 if (isValidKey == null) {
57 if (hashCode == null) { 57 if (hashCode == null) {
58 if (equals == null) { 58 if (equals == null) {
59 return new (_HashMap$(K, V))(); 59 return new (_HashMap$(K, V))();
60 } 60 }
61 hashCode = _defaultHashCode; 61 hashCode = _defaultHashCode;
62 } else { 62 } else {
63 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 63 if (core.identical(core.identityHashCode, hashCode) && core.identica l(core.identical, equals)) {
64 return new (_IdentityHashMap$(K, V))(); 64 return new (_IdentityHashMap$(K, V))();
65 } 65 }
66 if (equals == null) { 66 if (equals == null) {
67 equals = _defaultEquals; 67 equals = _defaultEquals;
68 } 68 }
69 } 69 }
70 } else { 70 } else {
71 if (hashCode == null) { 71 if (hashCode == null) {
72 hashCode = _defaultHashCode; 72 hashCode = _defaultHashCode;
73 } 73 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 do { 259 do {
260 buffer.write(`${iterator.current}`); 260 buffer.write(`${iterator.current}`);
261 } while (dart.notNull(iterator.moveNext())); 261 } while (dart.notNull(iterator.moveNext()));
262 } else { 262 } else {
263 buffer.write(`${iterator.current}`); 263 buffer.write(`${iterator.current}`);
264 while (dart.notNull(iterator.moveNext())) { 264 while (dart.notNull(iterator.moveNext())) {
265 buffer.write(separator); 265 buffer.write(separator);
266 buffer.write(`${iterator.current}`); 266 buffer.write(`${iterator.current}`);
267 } 267 }
268 } 268 }
269 return dart.toString(buffer); 269 return buffer.toString();
270 } 270 }
271 any(test) { 271 any(test) {
272 dart.as(test, dart.functionType(core.bool, [E])); 272 dart.as(test, dart.functionType(core.bool, [E]));
273 for (let element of this) { 273 for (let element of this) {
274 if (dart.notNull(test(element))) return true; 274 if (dart.notNull(test(element))) return true;
275 } 275 }
276 return false; 276 return false;
277 } 277 }
278 take(n) { 278 take(n) {
279 return _internal.TakeIterable$(E).new(this, n); 279 return _internal.TakeIterable$(E).new(this, n);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 let equals = opts && 'equals' in opts ? opts.equals : null; 476 let equals = opts && 'equals' in opts ? opts.equals : null;
477 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 477 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
478 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 478 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
479 if (isValidKey == null) { 479 if (isValidKey == null) {
480 if (hashCode == null) { 480 if (hashCode == null) {
481 if (equals == null) { 481 if (equals == null) {
482 return new (_HashSet$(E))(); 482 return new (_HashSet$(E))();
483 } 483 }
484 hashCode = _defaultHashCode; 484 hashCode = _defaultHashCode;
485 } else { 485 } else {
486 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 486 if (core.identical(core.identityHashCode, hashCode) && core.identica l(core.identical, equals)) {
487 return new (_IdentityHashSet$(E))(); 487 return new (_IdentityHashSet$(E))();
488 } 488 }
489 if (equals == null) { 489 if (equals == null) {
490 equals = _defaultEquals; 490 equals = _defaultEquals;
491 } 491 }
492 } 492 }
493 } else { 493 } else {
494 if (hashCode == null) { 494 if (hashCode == null) {
495 hashCode = _defaultHashCode; 495 hashCode = _defaultHashCode;
496 } 496 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 do { 584 do {
585 buffer.write(`${iterator.current}`); 585 buffer.write(`${iterator.current}`);
586 } while (dart.notNull(iterator.moveNext())); 586 } while (dart.notNull(iterator.moveNext()));
587 } else { 587 } else {
588 buffer.write(`${iterator.current}`); 588 buffer.write(`${iterator.current}`);
589 while (dart.notNull(iterator.moveNext())) { 589 while (dart.notNull(iterator.moveNext())) {
590 buffer.write(separator); 590 buffer.write(separator);
591 buffer.write(`${iterator.current}`); 591 buffer.write(`${iterator.current}`);
592 } 592 }
593 } 593 }
594 return dart.toString(buffer); 594 return buffer.toString();
595 } 595 }
596 any(f) { 596 any(f) {
597 dart.as(f, dart.functionType(core.bool, [E])); 597 dart.as(f, dart.functionType(core.bool, [E]));
598 for (let element of this) { 598 for (let element of this) {
599 if (dart.notNull(f(element))) return true; 599 if (dart.notNull(f(element))) return true;
600 } 600 }
601 return false; 601 return false;
602 } 602 }
603 toList(opts) { 603 toList(opts) {
604 let growable = opts && 'growable' in opts ? opts.growable : true; 604 let growable = opts && 'growable' in opts ? opts.growable : true;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 do { 838 do {
839 buffer.write(`${iterator.current}`); 839 buffer.write(`${iterator.current}`);
840 } while (dart.notNull(iterator.moveNext())); 840 } while (dart.notNull(iterator.moveNext()));
841 } else { 841 } else {
842 buffer.write(`${iterator.current}`); 842 buffer.write(`${iterator.current}`);
843 while (dart.notNull(iterator.moveNext())) { 843 while (dart.notNull(iterator.moveNext())) {
844 buffer.write(separator); 844 buffer.write(separator);
845 buffer.write(`${iterator.current}`); 845 buffer.write(`${iterator.current}`);
846 } 846 }
847 } 847 }
848 return dart.toString(buffer); 848 return buffer.toString();
849 } 849 }
850 any(f) { 850 any(f) {
851 dart.as(f, dart.functionType(core.bool, [E])); 851 dart.as(f, dart.functionType(core.bool, [E]));
852 for (let element of this) { 852 for (let element of this) {
853 if (dart.notNull(f(element))) return true; 853 if (dart.notNull(f(element))) return true;
854 } 854 }
855 return false; 855 return false;
856 } 856 }
857 toList(opts) { 857 toList(opts) {
858 let growable = opts && 'growable' in opts ? opts.growable : true; 858 let growable = opts && 'growable' in opts ? opts.growable : true;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 } 1002 }
1003 let buffer = new core.StringBuffer(leftDelimiter); 1003 let buffer = new core.StringBuffer(leftDelimiter);
1004 IterableBase$()._toStringVisiting[dartx.add](iterable); 1004 IterableBase$()._toStringVisiting[dartx.add](iterable);
1005 try { 1005 try {
1006 buffer.writeAll(iterable, ", "); 1006 buffer.writeAll(iterable, ", ");
1007 } finally { 1007 } finally {
1008 dart.assert(core.identical(IterableBase$()._toStringVisiting[dartx.las t], iterable)); 1008 dart.assert(core.identical(IterableBase$()._toStringVisiting[dartx.las t], iterable));
1009 IterableBase$()._toStringVisiting[dartx.removeLast](); 1009 IterableBase$()._toStringVisiting[dartx.removeLast]();
1010 } 1010 }
1011 buffer.write(rightDelimiter); 1011 buffer.write(rightDelimiter);
1012 return dart.toString(buffer); 1012 return buffer.toString();
1013 } 1013 }
1014 static _isToStringVisiting(o) { 1014 static _isToStringVisiting(o) {
1015 for (let i = 0; i < dart.notNull(IterableBase$()._toStringVisiting[dartx .length]); i++) { 1015 for (let i = 0; i < dart.notNull(IterableBase$()._toStringVisiting[dartx .length]); i++) {
1016 if (dart.notNull(core.identical(o, IterableBase$()._toStringVisiting[d artx.get](i)))) return true; 1016 if (core.identical(o, IterableBase$()._toStringVisiting[dartx.get](i)) ) return true;
1017 } 1017 }
1018 return false; 1018 return false;
1019 } 1019 }
1020 static _iterablePartsToStrings(iterable, parts) { 1020 static _iterablePartsToStrings(iterable, parts) {
1021 let LENGTH_LIMIT = 80; 1021 let LENGTH_LIMIT = 80;
1022 let HEAD_COUNT = 3; 1022 let HEAD_COUNT = 3;
1023 let TAIL_COUNT = 2; 1023 let TAIL_COUNT = 2;
1024 let MAX_COUNT = 100; 1024 let MAX_COUNT = 100;
1025 let OVERHEAD = 2; 1025 let OVERHEAD = 2;
1026 let ELLIPSIS_SIZE = 3; 1026 let ELLIPSIS_SIZE = 3;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 let equals = opts && 'equals' in opts ? opts.equals : null; 1213 let equals = opts && 'equals' in opts ? opts.equals : null;
1214 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1214 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1215 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1215 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1216 if (isValidKey == null) { 1216 if (isValidKey == null) {
1217 if (hashCode == null) { 1217 if (hashCode == null) {
1218 if (equals == null) { 1218 if (equals == null) {
1219 return new (_LinkedHashMap$(K, V))(); 1219 return new (_LinkedHashMap$(K, V))();
1220 } 1220 }
1221 hashCode = _defaultHashCode; 1221 hashCode = _defaultHashCode;
1222 } else { 1222 } else {
1223 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1223 if (core.identical(core.identityHashCode, hashCode) && core.identica l(core.identical, equals)) {
1224 return new (_LinkedIdentityHashMap$(K, V))(); 1224 return new (_LinkedIdentityHashMap$(K, V))();
1225 } 1225 }
1226 if (equals == null) { 1226 if (equals == null) {
1227 equals = _defaultEquals; 1227 equals = _defaultEquals;
1228 } 1228 }
1229 } 1229 }
1230 } else { 1230 } else {
1231 if (hashCode == null) { 1231 if (hashCode == null) {
1232 hashCode = _defaultHashCode; 1232 hashCode = _defaultHashCode;
1233 } 1233 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 let equals = opts && 'equals' in opts ? opts.equals : null; 1287 let equals = opts && 'equals' in opts ? opts.equals : null;
1288 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1288 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1289 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1289 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1290 if (isValidKey == null) { 1290 if (isValidKey == null) {
1291 if (hashCode == null) { 1291 if (hashCode == null) {
1292 if (equals == null) { 1292 if (equals == null) {
1293 return new (_LinkedHashSet$(E))(); 1293 return new (_LinkedHashSet$(E))();
1294 } 1294 }
1295 hashCode = _defaultHashCode; 1295 hashCode = _defaultHashCode;
1296 } else { 1296 } else {
1297 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1297 if (core.identical(core.identityHashCode, hashCode) && core.identica l(core.identical, equals)) {
1298 return new (_LinkedIdentityHashSet$(E))(); 1298 return new (_LinkedIdentityHashSet$(E))();
1299 } 1299 }
1300 if (equals == null) { 1300 if (equals == null) {
1301 equals = _defaultEquals; 1301 equals = _defaultEquals;
1302 } 1302 }
1303 } 1303 }
1304 } else { 1304 } else {
1305 if (hashCode == null) { 1305 if (hashCode == null) {
1306 hashCode = _defaultHashCode; 1306 hashCode = _defaultHashCode;
1307 } 1307 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 } 1373 }
1374 get iterator() { 1374 get iterator() {
1375 return new (_LinkedListIterator$(E))(this); 1375 return new (_LinkedListIterator$(E))(this);
1376 } 1376 }
1377 get length() { 1377 get length() {
1378 return this[_length]; 1378 return this[_length];
1379 } 1379 }
1380 clear() { 1380 clear() {
1381 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 1381 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
1382 let next = this[_next]; 1382 let next = this[_next];
1383 while (!dart.notNull(core.identical(next, this))) { 1383 while (!core.identical(next, this)) {
1384 let entry = dart.as(next, E); 1384 let entry = dart.as(next, E);
1385 next = entry[_next]; 1385 next = entry[_next];
1386 entry[_next] = entry[_previous] = entry[_list] = null; 1386 entry[_next] = entry[_previous] = entry[_list] = null;
1387 } 1387 }
1388 this[_next] = this[_previous] = this; 1388 this[_next] = this[_previous] = this;
1389 this[_length] = 0; 1389 this[_length] = 0;
1390 } 1390 }
1391 get first() { 1391 get first() {
1392 if (dart.notNull(core.identical(this[_next], this))) { 1392 if (core.identical(this[_next], this)) {
1393 dart.throw(new core.StateError('No such element')); 1393 dart.throw(new core.StateError('No such element'));
1394 } 1394 }
1395 return dart.as(this[_next], E); 1395 return dart.as(this[_next], E);
1396 } 1396 }
1397 get last() { 1397 get last() {
1398 if (dart.notNull(core.identical(this[_previous], this))) { 1398 if (core.identical(this[_previous], this)) {
1399 dart.throw(new core.StateError('No such element')); 1399 dart.throw(new core.StateError('No such element'));
1400 } 1400 }
1401 return dart.as(this[_previous], E); 1401 return dart.as(this[_previous], E);
1402 } 1402 }
1403 get single() { 1403 get single() {
1404 if (dart.notNull(core.identical(this[_previous], this))) { 1404 if (core.identical(this[_previous], this)) {
1405 dart.throw(new core.StateError('No such element')); 1405 dart.throw(new core.StateError('No such element'));
1406 } 1406 }
1407 if (!dart.notNull(core.identical(this[_previous], this[_next]))) { 1407 if (!core.identical(this[_previous], this[_next])) {
1408 dart.throw(new core.StateError('Too many elements')); 1408 dart.throw(new core.StateError('Too many elements'));
1409 } 1409 }
1410 return dart.as(this[_next], E); 1410 return dart.as(this[_next], E);
1411 } 1411 }
1412 forEach(action) { 1412 forEach(action) {
1413 dart.as(action, dart.functionType(dart.void, [E])); 1413 dart.as(action, dart.functionType(dart.void, [E]));
1414 let modificationCount = this[_modificationCount]; 1414 let modificationCount = this[_modificationCount];
1415 let current = this[_next]; 1415 let current = this[_next];
1416 while (!dart.notNull(core.identical(current, this))) { 1416 while (!core.identical(current, this)) {
1417 action(dart.as(current, E)); 1417 action(dart.as(current, E));
1418 if (modificationCount != this[_modificationCount]) { 1418 if (modificationCount != this[_modificationCount]) {
1419 dart.throw(new core.ConcurrentModificationError(this)); 1419 dart.throw(new core.ConcurrentModificationError(this));
1420 } 1420 }
1421 current = current[_next]; 1421 current = current[_next];
1422 } 1422 }
1423 } 1423 }
1424 get isEmpty() { 1424 get isEmpty() {
1425 return this[_length] == 0; 1425 return this[_length] == 0;
1426 } 1426 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 _LinkedListIterator(list) { 1480 _LinkedListIterator(list) {
1481 this[_list] = list; 1481 this[_list] = list;
1482 this[_modificationCount] = list[_modificationCount]; 1482 this[_modificationCount] = list[_modificationCount];
1483 this[_next] = list[_next]; 1483 this[_next] = list[_next];
1484 this[_current] = null; 1484 this[_current] = null;
1485 } 1485 }
1486 get current() { 1486 get current() {
1487 return this[_current]; 1487 return this[_current];
1488 } 1488 }
1489 moveNext() { 1489 moveNext() {
1490 if (dart.notNull(core.identical(this[_next], this[_list]))) { 1490 if (core.identical(this[_next], this[_list])) {
1491 this[_current] = null; 1491 this[_current] = null;
1492 return false; 1492 return false;
1493 } 1493 }
1494 if (this[_modificationCount] != this[_list][_modificationCount]) { 1494 if (this[_modificationCount] != this[_list][_modificationCount]) {
1495 dart.throw(new core.ConcurrentModificationError(this)); 1495 dart.throw(new core.ConcurrentModificationError(this));
1496 } 1496 }
1497 this[_current] = dart.as(this[_next], E); 1497 this[_current] = dart.as(this[_next], E);
1498 this[_next] = this[_next][_next]; 1498 this[_next] = this[_next][_next];
1499 return true; 1499 return true;
1500 } 1500 }
(...skipping 19 matching lines...) Expand all
1520 this[_next] = null; 1520 this[_next] = null;
1521 this[_previous] = null; 1521 this[_previous] = null;
1522 } 1522 }
1523 get list() { 1523 get list() {
1524 return this[_list]; 1524 return this[_list];
1525 } 1525 }
1526 unlink() { 1526 unlink() {
1527 this[_list][_unlink](this); 1527 this[_list][_unlink](this);
1528 } 1528 }
1529 get next() { 1529 get next() {
1530 if (dart.notNull(core.identical(this[_next], this[_list]))) return null; 1530 if (core.identical(this[_next], this[_list])) return null;
1531 let result = dart.as(this[_next], E); 1531 let result = dart.as(this[_next], E);
1532 return result; 1532 return result;
1533 } 1533 }
1534 get previous() { 1534 get previous() {
1535 if (dart.notNull(core.identical(this[_previous], this[_list]))) return n ull; 1535 if (core.identical(this[_previous], this[_list])) return null;
1536 return dart.as(this[_previous], E); 1536 return dart.as(this[_previous], E);
1537 } 1537 }
1538 insertAfter(entry) { 1538 insertAfter(entry) {
1539 dart.as(entry, E); 1539 dart.as(entry, E);
1540 this[_list][_insertAfter](this, entry); 1540 this[_list][_insertAfter](this, entry);
1541 } 1541 }
1542 insertBefore(entry) { 1542 insertBefore(entry) {
1543 dart.as(entry, E); 1543 dart.as(entry, E);
1544 this[_list][_insertAfter](this[_previous], entry); 1544 this[_list][_insertAfter](this[_previous], entry);
1545 } 1545 }
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 first = false; 2494 first = false;
2495 result.write(k); 2495 result.write(k);
2496 result.write(': '); 2496 result.write(': ');
2497 result.write(v); 2497 result.write(v);
2498 }, dart.void, [dart.dynamic, dart.dynamic])); 2498 }, dart.void, [dart.dynamic, dart.dynamic]));
2499 result.write('}'); 2499 result.write('}');
2500 } finally { 2500 } finally {
2501 dart.assert(core.identical(IterableBase._toStringVisiting[dartx.last], m )); 2501 dart.assert(core.identical(IterableBase._toStringVisiting[dartx.last], m ));
2502 IterableBase._toStringVisiting[dartx.removeLast](); 2502 IterableBase._toStringVisiting[dartx.removeLast]();
2503 } 2503 }
2504 return dart.toString(result); 2504 return result.toString();
2505 } 2505 }
2506 static _id(x) { 2506 static _id(x) {
2507 return x; 2507 return x;
2508 } 2508 }
2509 static _fillMapWithMappedIterable(map, iterable, key, value) { 2509 static _fillMapWithMappedIterable(map, iterable, key, value) {
2510 if (key == null) key = Maps._id; 2510 if (key == null) key = Maps._id;
2511 if (value == null) value = Maps._id; 2511 if (value == null) value = Maps._id;
2512 for (let element of iterable) { 2512 for (let element of iterable) {
2513 map[dartx.set](dart.dcall(key, element), dart.dcall(value, element)); 2513 map[dartx.set](dart.dcall(key, element), dart.dcall(value, element));
2514 } 2514 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; 2711 this[_elementCount] = dart.notNull(this[_elementCount]) - 1;
2712 return result; 2712 return result;
2713 } 2713 }
2714 removeFirst() { 2714 removeFirst() {
2715 let result = this[_sentinel][_next].remove(); 2715 let result = this[_sentinel][_next].remove();
2716 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; 2716 this[_elementCount] = dart.notNull(this[_elementCount]) - 1;
2717 return result; 2717 return result;
2718 } 2718 }
2719 remove(o) { 2719 remove(o) {
2720 let entry = this[_sentinel][_next]; 2720 let entry = this[_sentinel][_next];
2721 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { 2721 while (!core.identical(entry, this[_sentinel])) {
2722 if (dart.equals(entry.element, o)) { 2722 if (dart.equals(entry.element, o)) {
2723 entry.remove(); 2723 entry.remove();
2724 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; 2724 this[_elementCount] = dart.notNull(this[_elementCount]) - 1;
2725 return true; 2725 return true;
2726 } 2726 }
2727 entry = entry[_next]; 2727 entry = entry[_next];
2728 } 2728 }
2729 return false; 2729 return false;
2730 } 2730 }
2731 [_filter](test, removeMatching) { 2731 [_filter](test, removeMatching) {
2732 dart.as(test, dart.functionType(core.bool, [E])); 2732 dart.as(test, dart.functionType(core.bool, [E]));
2733 let entry = this[_sentinel][_next]; 2733 let entry = this[_sentinel][_next];
2734 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { 2734 while (!core.identical(entry, this[_sentinel])) {
2735 let next = entry[_next]; 2735 let next = entry[_next];
2736 if (dart.notNull(core.identical(removeMatching, test(entry.element)))) { 2736 if (core.identical(removeMatching, test(entry.element))) {
2737 entry.remove(); 2737 entry.remove();
2738 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; 2738 this[_elementCount] = dart.notNull(this[_elementCount]) - 1;
2739 } 2739 }
2740 entry = next; 2740 entry = next;
2741 } 2741 }
2742 } 2742 }
2743 removeWhere(test) { 2743 removeWhere(test) {
2744 dart.as(test, dart.functionType(core.bool, [E])); 2744 dart.as(test, dart.functionType(core.bool, [E]));
2745 this[_filter](test, true); 2745 this[_filter](test, true);
2746 } 2746 }
2747 retainWhere(test) { 2747 retainWhere(test) {
2748 dart.as(test, dart.functionType(core.bool, [E])); 2748 dart.as(test, dart.functionType(core.bool, [E]));
2749 this[_filter](test, false); 2749 this[_filter](test, false);
2750 } 2750 }
2751 get first() { 2751 get first() {
2752 return this[_sentinel][_next].element; 2752 return this[_sentinel][_next].element;
2753 } 2753 }
2754 get last() { 2754 get last() {
2755 return this[_sentinel][_previous].element; 2755 return this[_sentinel][_previous].element;
2756 } 2756 }
2757 get single() { 2757 get single() {
2758 if (dart.notNull(core.identical(this[_sentinel][_next], this[_sentinel][ _previous]))) { 2758 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous])) {
2759 return this[_sentinel][_next].element; 2759 return this[_sentinel][_next].element;
2760 } 2760 }
2761 dart.throw(_internal.IterableElementError.tooMany()); 2761 dart.throw(_internal.IterableElementError.tooMany());
2762 } 2762 }
2763 lastEntry() { 2763 lastEntry() {
2764 return this[_sentinel].previousEntry(); 2764 return this[_sentinel].previousEntry();
2765 } 2765 }
2766 firstEntry() { 2766 firstEntry() {
2767 return this[_sentinel].nextEntry(); 2767 return this[_sentinel].nextEntry();
2768 } 2768 }
2769 get isEmpty() { 2769 get isEmpty() {
2770 return core.identical(this[_sentinel][_next], this[_sentinel]); 2770 return core.identical(this[_sentinel][_next], this[_sentinel]);
2771 } 2771 }
2772 clear() { 2772 clear() {
2773 this[_sentinel][_next] = this[_sentinel]; 2773 this[_sentinel][_next] = this[_sentinel];
2774 this[_sentinel][_previous] = this[_sentinel]; 2774 this[_sentinel][_previous] = this[_sentinel];
2775 this[_elementCount] = 0; 2775 this[_elementCount] = 0;
2776 } 2776 }
2777 forEachEntry(f) { 2777 forEachEntry(f) {
2778 dart.as(f, dart.functionType(dart.void, [DoubleLinkedQueueEntry$(E)])); 2778 dart.as(f, dart.functionType(dart.void, [DoubleLinkedQueueEntry$(E)]));
2779 let entry = this[_sentinel][_next]; 2779 let entry = this[_sentinel][_next];
2780 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { 2780 while (!core.identical(entry, this[_sentinel])) {
2781 let nextEntry = entry[_next]; 2781 let nextEntry = entry[_next];
2782 f(entry); 2782 f(entry);
2783 entry = nextEntry; 2783 entry = nextEntry;
2784 } 2784 }
2785 } 2785 }
2786 get iterator() { 2786 get iterator() {
2787 return new (_DoubleLinkedQueueIterator$(E))(this[_sentinel]); 2787 return new (_DoubleLinkedQueueIterator$(E))(this[_sentinel]);
2788 } 2788 }
2789 toString() { 2789 toString() {
2790 return IterableBase.iterableToFullString(this, '{', '}'); 2790 return IterableBase.iterableToFullString(this, '{', '}');
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 let DoubleLinkedQueue = DoubleLinkedQueue$(); 2826 let DoubleLinkedQueue = DoubleLinkedQueue$();
2827 const _nextEntry = Symbol('_nextEntry'); 2827 const _nextEntry = Symbol('_nextEntry');
2828 const _DoubleLinkedQueueIterator$ = dart.generic(function(E) { 2828 const _DoubleLinkedQueueIterator$ = dart.generic(function(E) {
2829 class _DoubleLinkedQueueIterator extends core.Object { 2829 class _DoubleLinkedQueueIterator extends core.Object {
2830 _DoubleLinkedQueueIterator(sentinel) { 2830 _DoubleLinkedQueueIterator(sentinel) {
2831 this[_sentinel] = sentinel; 2831 this[_sentinel] = sentinel;
2832 this[_nextEntry] = sentinel[_next]; 2832 this[_nextEntry] = sentinel[_next];
2833 this[_current] = null; 2833 this[_current] = null;
2834 } 2834 }
2835 moveNext() { 2835 moveNext() {
2836 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) { 2836 if (!core.identical(this[_nextEntry], this[_sentinel])) {
2837 this[_current] = this[_nextEntry][_element]; 2837 this[_current] = this[_nextEntry][_element];
2838 this[_nextEntry] = this[_nextEntry][_next]; 2838 this[_nextEntry] = this[_nextEntry][_next];
2839 return true; 2839 return true;
2840 } 2840 }
2841 this[_current] = null; 2841 this[_current] = null;
2842 this[_nextEntry] = this[_sentinel] = null; 2842 this[_nextEntry] = this[_sentinel] = null;
2843 return false; 2843 return false;
2844 } 2844 }
2845 get current() { 2845 get current() {
2846 return this[_current]; 2846 return this[_current];
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2993 } 2993 }
2994 [_filterWhere](test, removeMatching) { 2994 [_filterWhere](test, removeMatching) {
2995 dart.as(test, dart.functionType(core.bool, [E])); 2995 dart.as(test, dart.functionType(core.bool, [E]));
2996 let index = this[_head]; 2996 let index = this[_head];
2997 let modificationCount = this[_modificationCount]; 2997 let modificationCount = this[_modificationCount];
2998 let i = this[_head]; 2998 let i = this[_head];
2999 while (i != this[_tail]) { 2999 while (i != this[_tail]) {
3000 let element = this[_table][dartx.get](i); 3000 let element = this[_table][dartx.get](i);
3001 let remove = core.identical(removeMatching, test(element)); 3001 let remove = core.identical(removeMatching, test(element));
3002 this[_checkModification](modificationCount); 3002 this[_checkModification](modificationCount);
3003 if (dart.notNull(remove)) { 3003 if (remove) {
3004 i = this[_remove](i); 3004 i = this[_remove](i);
3005 modificationCount = this[_modificationCount] = dart.notNull(this[_mo dificationCount]) + 1; 3005 modificationCount = this[_modificationCount] = dart.notNull(this[_mo dificationCount]) + 1;
3006 } else { 3006 } else {
3007 i = dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1; 3007 i = dart.notNull(i) + 1 & dart.notNull(this[_table][dartx.length]) - 1;
3008 } 3008 }
3009 } 3009 }
3010 } 3010 }
3011 removeWhere(test) { 3011 removeWhere(test) {
3012 dart.as(test, dart.functionType(core.bool, [E])); 3012 dart.as(test, dart.functionType(core.bool, [E]));
3013 this[_filterWhere](test, true); 3013 this[_filterWhere](test, true);
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
4353 _IdentityHashMap() { 4353 _IdentityHashMap() {
4354 super._HashMap(); 4354 super._HashMap();
4355 } 4355 }
4356 [_computeHashCode](key) { 4356 [_computeHashCode](key) {
4357 return core.identityHashCode(key) & 0x3ffffff; 4357 return core.identityHashCode(key) & 0x3ffffff;
4358 } 4358 }
4359 [_findBucketIndex](bucket, key) { 4359 [_findBucketIndex](bucket, key) {
4360 if (bucket == null) return -1; 4360 if (bucket == null) return -1;
4361 let length = bucket.length; 4361 let length = bucket.length;
4362 for (let i = 0; i < length; i = i + 2) { 4362 for (let i = 0; i < length; i = i + 2) {
4363 if (dart.notNull(core.identical(bucket[i], key))) return i; 4363 if (core.identical(bucket[i], key)) return i;
4364 } 4364 }
4365 return -1; 4365 return -1;
4366 } 4366 }
4367 } 4367 }
4368 return _IdentityHashMap; 4368 return _IdentityHashMap;
4369 }); 4369 });
4370 let _IdentityHashMap = _IdentityHashMap$(); 4370 let _IdentityHashMap = _IdentityHashMap$();
4371 const _equals = Symbol('_equals'); 4371 const _equals = Symbol('_equals');
4372 const _hashCode = Symbol('_hashCode'); 4372 const _hashCode = Symbol('_hashCode');
4373 const _CustomHashMap$ = dart.generic(function(K, V) { 4373 const _CustomHashMap$ = dart.generic(function(K, V) {
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
4831 super._LinkedHashMap(); 4831 super._LinkedHashMap();
4832 } 4832 }
4833 [_computeHashCode](key) { 4833 [_computeHashCode](key) {
4834 return core.identityHashCode(key) & 0x3ffffff; 4834 return core.identityHashCode(key) & 0x3ffffff;
4835 } 4835 }
4836 [_findBucketIndex](bucket, key) { 4836 [_findBucketIndex](bucket, key) {
4837 if (bucket == null) return -1; 4837 if (bucket == null) return -1;
4838 let length = bucket.length; 4838 let length = bucket.length;
4839 for (let i = 0; i < length; i++) { 4839 for (let i = 0; i < length; i++) {
4840 let cell = dart.as(bucket[i], LinkedHashMapCell); 4840 let cell = dart.as(bucket[i], LinkedHashMapCell);
4841 if (dart.notNull(core.identical(cell[_key], key))) return i; 4841 if (core.identical(cell[_key], key)) return i;
4842 } 4842 }
4843 return -1; 4843 return -1;
4844 } 4844 }
4845 } 4845 }
4846 return _LinkedIdentityHashMap; 4846 return _LinkedIdentityHashMap;
4847 }); 4847 });
4848 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(); 4848 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$();
4849 const _LinkedCustomHashMap$ = dart.generic(function(K, V) { 4849 const _LinkedCustomHashMap$ = dart.generic(function(K, V) {
4850 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { 4850 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) {
4851 _LinkedCustomHashMap(equals, hashCode, validKey) { 4851 _LinkedCustomHashMap(equals, hashCode, validKey) {
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
5258 [_newSet]() { 5258 [_newSet]() {
5259 return new (_IdentityHashSet$(E))(); 5259 return new (_IdentityHashSet$(E))();
5260 } 5260 }
5261 [_computeHashCode](key) { 5261 [_computeHashCode](key) {
5262 return core.identityHashCode(key) & 0x3ffffff; 5262 return core.identityHashCode(key) & 0x3ffffff;
5263 } 5263 }
5264 [_findBucketIndex](bucket, element) { 5264 [_findBucketIndex](bucket, element) {
5265 if (bucket == null) return -1; 5265 if (bucket == null) return -1;
5266 let length = bucket.length; 5266 let length = bucket.length;
5267 for (let i = 0; i < length; i++) { 5267 for (let i = 0; i < length; i++) {
5268 if (dart.notNull(core.identical(bucket[i], element))) return i; 5268 if (core.identical(bucket[i], element)) return i;
5269 } 5269 }
5270 return -1; 5270 return -1;
5271 } 5271 }
5272 } 5272 }
5273 dart.setSignature(_IdentityHashSet, { 5273 dart.setSignature(_IdentityHashSet, {
5274 methods: () => ({[_newSet]: [core.Set$(E), []]}) 5274 methods: () => ({[_newSet]: [core.Set$(E), []]})
5275 }); 5275 });
5276 return _IdentityHashSet; 5276 return _IdentityHashSet;
5277 }); 5277 });
5278 let _IdentityHashSet = _IdentityHashSet$(); 5278 let _IdentityHashSet = _IdentityHashSet$();
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
5678 return new (_LinkedIdentityHashSet$(E))(); 5678 return new (_LinkedIdentityHashSet$(E))();
5679 } 5679 }
5680 [_computeHashCode](key) { 5680 [_computeHashCode](key) {
5681 return core.identityHashCode(key) & 0x3ffffff; 5681 return core.identityHashCode(key) & 0x3ffffff;
5682 } 5682 }
5683 [_findBucketIndex](bucket, element) { 5683 [_findBucketIndex](bucket, element) {
5684 if (bucket == null) return -1; 5684 if (bucket == null) return -1;
5685 let length = bucket.length; 5685 let length = bucket.length;
5686 for (let i = 0; i < length; i++) { 5686 for (let i = 0; i < length; i++) {
5687 let cell = dart.as(bucket[i], LinkedHashSetCell); 5687 let cell = dart.as(bucket[i], LinkedHashSetCell);
5688 if (dart.notNull(core.identical(cell[_element], element))) return i; 5688 if (core.identical(cell[_element], element)) return i;
5689 } 5689 }
5690 return -1; 5690 return -1;
5691 } 5691 }
5692 } 5692 }
5693 dart.setSignature(_LinkedIdentityHashSet, { 5693 dart.setSignature(_LinkedIdentityHashSet, {
5694 methods: () => ({[_newSet]: [core.Set$(E), []]}) 5694 methods: () => ({[_newSet]: [core.Set$(E), []]})
5695 }); 5695 });
5696 return _LinkedIdentityHashSet; 5696 return _LinkedIdentityHashSet;
5697 }); 5697 });
5698 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(); 5698 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$();
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
5863 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 5863 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
5864 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 5864 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
5865 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 5865 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
5866 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 5866 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
5867 exports.HashSetIterator$ = HashSetIterator$; 5867 exports.HashSetIterator$ = HashSetIterator$;
5868 exports.HashSetIterator = HashSetIterator; 5868 exports.HashSetIterator = HashSetIterator;
5869 exports.LinkedHashSetCell = LinkedHashSetCell; 5869 exports.LinkedHashSetCell = LinkedHashSetCell;
5870 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 5870 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
5871 exports.LinkedHashSetIterator = LinkedHashSetIterator; 5871 exports.LinkedHashSetIterator = LinkedHashSetIterator;
5872 }); 5872 });
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