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

Side by Side Diff: frog/minfrog

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/lib/corelib_impl.dart ('k') | frog/utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 function $throw(e) { 4 function $throw(e) {
5 // If e is not a value, we can use V8's captureStackTrace utility method. 5 // If e is not a value, we can use V8's captureStackTrace utility method.
6 // TODO(jmesserly): capture the stack trace on other JS engines. 6 // TODO(jmesserly): capture the stack trace on other JS engines.
7 if (e && (typeof e == 'object') && Error.captureStackTrace) { 7 if (e && (typeof e == 'object') && Error.captureStackTrace) {
8 // TODO(jmesserly): this will clobber the e.stack property 8 // TODO(jmesserly): this will clobber the e.stack property
9 Error.captureStackTrace(e, $throw); 9 Error.captureStackTrace(e, $throw);
10 } 10 }
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return this.noSuchMethod("isEmpty", []); 258 return this.noSuchMethod("isEmpty", []);
259 }, enumerable: false, configurable: true }); 259 }, enumerable: false, configurable: true });
260 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { 260 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) {
261 return this.noSuchMethod("isSubtypeOf", [$0]); 261 return this.noSuchMethod("isSubtypeOf", [$0]);
262 }, enumerable: false, configurable: true }); 262 }, enumerable: false, configurable: true });
263 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { 263 Object.defineProperty(Object.prototype, "iterator$0", { value: function() {
264 return this.noSuchMethod("iterator", []); 264 return this.noSuchMethod("iterator", []);
265 }, enumerable: false, configurable: true }); 265 }, enumerable: false, configurable: true });
266 Object.defineProperty(Object.prototype, "last$0", { value: function() { 266 Object.defineProperty(Object.prototype, "last$0", { value: function() {
267 return this.noSuchMethod("last", []); 267 return this.noSuchMethod("last", []);
268 Object.defineProperty(Object.prototype, "map$1", { value: function($0) {
269 return this.noSuchMethod("map", [$0]);
268 }, enumerable: false, configurable: true }); 270 }, enumerable: false, configurable: true });
269 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { 271 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() {
270 return this.noSuchMethod("markUsed", []); 272 return this.noSuchMethod("markUsed", []);
271 }, enumerable: false, configurable: true }); 273 }, enumerable: false, configurable: true });
272 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0) { 274 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0) {
273 return this.noSuchMethod("namesInOrder", [$0]); 275 return this.noSuchMethod("namesInOrder", [$0]);
274 }, enumerable: false, configurable: true }); 276 }, enumerable: false, configurable: true });
275 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($ 0) { 277 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($ 0) {
276 return this.noSuchMethod("needsConversion", [$0]); 278 return this.noSuchMethod("needsConversion", [$0]);
277 }, enumerable: false, configurable: true }); 279 }, enumerable: false, configurable: true });
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) { 618 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) {
617 return this.filter(to$call$1($0)); 619 return this.filter(to$call$1($0));
618 }, enumerable: false, configurable: true }); 620 }, enumerable: false, configurable: true });
619 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0) { 621 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0) {
620 return this.forEach(to$call$1($0)); 622 return this.forEach(to$call$1($0));
621 }, enumerable: false, configurable: true }); 623 }, enumerable: false, configurable: true });
622 Object.defineProperty(ListFactory.prototype, "indexOf$1", { value: ListFactory.p rototype.indexOf, enumerable: false, configurable: true }); 624 Object.defineProperty(ListFactory.prototype, "indexOf$1", { value: ListFactory.p rototype.indexOf, enumerable: false, configurable: true });
623 Object.defineProperty(ListFactory.prototype, "isEmpty$0", { value: ListFactory.p rototype.isEmpty, enumerable: false, configurable: true }); 625 Object.defineProperty(ListFactory.prototype, "isEmpty$0", { value: ListFactory.p rototype.isEmpty, enumerable: false, configurable: true });
624 Object.defineProperty(ListFactory.prototype, "iterator$0", { value: ListFactory. prototype.iterator, enumerable: false, configurable: true }); 626 Object.defineProperty(ListFactory.prototype, "iterator$0", { value: ListFactory. prototype.iterator, enumerable: false, configurable: true });
625 Object.defineProperty(ListFactory.prototype, "last$0", { value: ListFactory.prot otype.last, enumerable: false, configurable: true }); 627 Object.defineProperty(ListFactory.prototype, "last$0", { value: ListFactory.prot otype.last, enumerable: false, configurable: true });
628 Object.defineProperty(ListFactory.prototype, "map$1", { value: function($0) {
629 return this.map(to$call$1($0));
630 }, enumerable: false, configurable: true });
626 Object.defineProperty(ListFactory.prototype, "removeLast$0", { value: ListFactor y.prototype.removeLast, enumerable: false, configurable: true }); 631 Object.defineProperty(ListFactory.prototype, "removeLast$0", { value: ListFactor y.prototype.removeLast, enumerable: false, configurable: true });
627 Object.defineProperty(ListFactory.prototype, "some$1", { value: function($0) { 632 Object.defineProperty(ListFactory.prototype, "some$1", { value: function($0) {
628 return this.some(to$call$1($0)); 633 return this.some(to$call$1($0));
629 }, enumerable: false, configurable: true }); 634 }, enumerable: false, configurable: true });
630 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) { 635 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) {
631 return this.sort(to$call$2($0)); 636 return this.sort(to$call$2($0));
632 }, enumerable: false, configurable: true }); 637 }, enumerable: false, configurable: true });
633 ListFactory_E = ListFactory; 638 ListFactory_E = ListFactory;
634 ListFactory_Expression = ListFactory; 639 ListFactory_Expression = ListFactory;
635 ListFactory_K = ListFactory; 640 ListFactory_K = ListFactory;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 $this.add(value); 1116 $this.add(value);
1112 } 1117 }
1113 ); 1118 );
1114 } 1119 }
1115 HashSetImplementation.prototype.forEach = function(f) { 1120 HashSetImplementation.prototype.forEach = function(f) {
1116 this._backingMap.forEach(function _(key, value) { 1121 this._backingMap.forEach(function _(key, value) {
1117 f(key); 1122 f(key);
1118 } 1123 }
1119 ); 1124 );
1120 } 1125 }
1126 HashSetImplementation.prototype.map = function(f) {
1127 var result = new HashSetImplementation();
1128 this._backingMap.forEach(function _(key, value) {
1129 result.add(f(key));
1130 }
1131 );
1132 return result;
1133 }
1121 HashSetImplementation.prototype.filter = function(f) { 1134 HashSetImplementation.prototype.filter = function(f) {
1122 var result = new HashSetImplementation(); 1135 var result = new HashSetImplementation();
1123 this._backingMap.forEach(function _(key, value) { 1136 this._backingMap.forEach(function _(key, value) {
1124 if (f(key)) result.add(key); 1137 if (f(key)) result.add(key);
1125 } 1138 }
1126 ); 1139 );
1127 return result; 1140 return result;
1128 } 1141 }
1129 HashSetImplementation.prototype.every = function(f) { 1142 HashSetImplementation.prototype.every = function(f) {
1130 var keys = this._backingMap.getKeys(); 1143 var keys = this._backingMap.getKeys();
(...skipping 19 matching lines...) Expand all
1150 return this.every(to$call$1($0)); 1163 return this.every(to$call$1($0));
1151 }; 1164 };
1152 HashSetImplementation.prototype.filter$1 = function($0) { 1165 HashSetImplementation.prototype.filter$1 = function($0) {
1153 return this.filter(to$call$1($0)); 1166 return this.filter(to$call$1($0));
1154 }; 1167 };
1155 HashSetImplementation.prototype.forEach$1 = function($0) { 1168 HashSetImplementation.prototype.forEach$1 = function($0) {
1156 return this.forEach(to$call$1($0)); 1169 return this.forEach(to$call$1($0));
1157 }; 1170 };
1158 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm pty; 1171 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm pty;
1159 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite rator; 1172 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite rator;
1173 HashSetImplementation.prototype.map$1 = function($0) {
1174 return this.map(to$call$1($0));
1175 };
1160 HashSetImplementation.prototype.some$1 = function($0) { 1176 HashSetImplementation.prototype.some$1 = function($0) {
1161 return this.some(to$call$1($0)); 1177 return this.some(to$call$1($0));
1162 }; 1178 };
1163 // ********** Code for HashSetImplementation_E ************** 1179 // ********** Code for HashSetImplementation_E **************
1164 $inherits(HashSetImplementation_E, HashSetImplementation); 1180 $inherits(HashSetImplementation_E, HashSetImplementation);
1165 function HashSetImplementation_E() { 1181 function HashSetImplementation_E() {
1166 this._backingMap = new HashMapImplementation_E$E(); 1182 this._backingMap = new HashMapImplementation_E$E();
1167 } 1183 }
1168 // ********** Code for HashSetImplementation_Library ************** 1184 // ********** Code for HashSetImplementation_Library **************
1169 $inherits(HashSetImplementation_Library, HashSetImplementation); 1185 $inherits(HashSetImplementation_Library, HashSetImplementation);
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 } 1493 }
1478 DoubleLinkedQueue.prototype.some = function(f) { 1494 DoubleLinkedQueue.prototype.some = function(f) {
1479 var entry = this._sentinel._next; 1495 var entry = this._sentinel._next;
1480 while (entry != this._sentinel) { 1496 while (entry != this._sentinel) {
1481 var nextEntry = entry._next; 1497 var nextEntry = entry._next;
1482 if (f(entry._element)) return true; 1498 if (f(entry._element)) return true;
1483 entry = nextEntry; 1499 entry = nextEntry;
1484 } 1500 }
1485 return false; 1501 return false;
1486 } 1502 }
1503 DoubleLinkedQueue.prototype.map = function(f) {
1504 var other = new DoubleLinkedQueue();
1505 var entry = this._sentinel._next;
1506 while (entry !== this._sentinel) {
1507 var nextEntry = entry._next;
1508 other.addLast(f(entry._element));
1509 entry = nextEntry;
1510 }
1511 return other;
1512 }
1487 DoubleLinkedQueue.prototype.filter = function(f) { 1513 DoubleLinkedQueue.prototype.filter = function(f) {
1488 var other = new DoubleLinkedQueue(); 1514 var other = new DoubleLinkedQueue();
1489 var entry = this._sentinel._next; 1515 var entry = this._sentinel._next;
1490 while (entry != this._sentinel) { 1516 while (entry != this._sentinel) {
1491 var nextEntry = entry._next; 1517 var nextEntry = entry._next;
1492 if (f(entry._element)) other.addLast(entry._element); 1518 if (f(entry._element)) other.addLast(entry._element);
1493 entry = nextEntry; 1519 entry = nextEntry;
1494 } 1520 }
1495 return other; 1521 return other;
1496 } 1522 }
1497 DoubleLinkedQueue.prototype.iterator = function() { 1523 DoubleLinkedQueue.prototype.iterator = function() {
1498 return new _DoubleLinkedQueueIterator_E(this._sentinel); 1524 return new _DoubleLinkedQueueIterator_E(this._sentinel);
1499 } 1525 }
1500 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; 1526 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add;
1501 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; 1527 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll;
1502 DoubleLinkedQueue.prototype.every$1 = function($0) { 1528 DoubleLinkedQueue.prototype.every$1 = function($0) {
1503 return this.every(to$call$1($0)); 1529 return this.every(to$call$1($0));
1504 }; 1530 };
1505 DoubleLinkedQueue.prototype.filter$1 = function($0) { 1531 DoubleLinkedQueue.prototype.filter$1 = function($0) {
1506 return this.filter(to$call$1($0)); 1532 return this.filter(to$call$1($0));
1507 }; 1533 };
1508 DoubleLinkedQueue.prototype.forEach$1 = function($0) { 1534 DoubleLinkedQueue.prototype.forEach$1 = function($0) {
1509 return this.forEach(to$call$1($0)); 1535 return this.forEach(to$call$1($0));
1510 }; 1536 };
1511 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; 1537 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty;
1512 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; 1538 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator;
1513 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; 1539 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last;
1540 DoubleLinkedQueue.prototype.map$1 = function($0) {
1541 return this.map(to$call$1($0));
1542 };
1514 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas t; 1543 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas t;
1515 DoubleLinkedQueue.prototype.some$1 = function($0) { 1544 DoubleLinkedQueue.prototype.some$1 = function($0) {
1516 return this.some(to$call$1($0)); 1545 return this.some(to$call$1($0));
1517 }; 1546 };
1518 // ********** Code for DoubleLinkedQueue_E ************** 1547 // ********** Code for DoubleLinkedQueue_E **************
1519 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); 1548 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue);
1520 function DoubleLinkedQueue_E() {} 1549 function DoubleLinkedQueue_E() {}
1521 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** 1550 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V **************
1522 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); 1551 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue);
1523 function DoubleLinkedQueue_KeyValuePair_K$V() { 1552 function DoubleLinkedQueue_KeyValuePair_K$V() {
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 } 1791 }
1763 return true; 1792 return true;
1764 } 1793 }
1765 Collections.filter = function(source, destination, f) { 1794 Collections.filter = function(source, destination, f) {
1766 for (var $$i = source.iterator(); $$i.hasNext$0(); ) { 1795 for (var $$i = source.iterator(); $$i.hasNext$0(); ) {
1767 var e = $$i.next$0(); 1796 var e = $$i.next$0();
1768 if (f(e)) destination.add(e); 1797 if (f(e)) destination.add(e);
1769 } 1798 }
1770 return destination; 1799 return destination;
1771 } 1800 }
1801 Collections.map = function(source, destination, f) {
1802 for (var $$i = source.iterator(); $$i.hasNext$0(); ) {
1803 var e = $$i.next$0();
1804 destination.add(f(e));
1805 }
1806 return destination;
1807 }
1772 // ********** Code for _Worker ************** 1808 // ********** Code for _Worker **************
1773 // ********** Code for _ArgumentMismatchException ************** 1809 // ********** Code for _ArgumentMismatchException **************
1774 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); 1810 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException);
1775 function _ArgumentMismatchException(_message) { 1811 function _ArgumentMismatchException(_message) {
1776 this._dart_coreimpl_message = _message; 1812 this._dart_coreimpl_message = _message;
1777 ClosureArgumentMismatchException.call(this); 1813 ClosureArgumentMismatchException.call(this);
1778 } 1814 }
1779 _ArgumentMismatchException.prototype.toString = function() { 1815 _ArgumentMismatchException.prototype.toString = function() {
1780 return ("Closure argument mismatch: " + this._dart_coreimpl_message); 1816 return ("Closure argument mismatch: " + this._dart_coreimpl_message);
1781 } 1817 }
(...skipping 12193 matching lines...) Expand 10 before | Expand all | Expand 10 after
13975 $globals._RED_COLOR = "\x1b[31m"; 14011 $globals._RED_COLOR = "\x1b[31m";
13976 } 14012 }
13977 var const$0000 = Object.create(EmptyQueueException.prototype, {}); 14013 var const$0000 = Object.create(EmptyQueueException.prototype, {});
13978 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); 14014 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {});
13979 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); 14015 var const$0005 = Object.create(NoMoreElementsException.prototype, {});
13980 var const$0007 = Object.create(IllegalAccessException.prototype, {}); 14016 var const$0007 = Object.create(IllegalAccessException.prototype, {});
13981 var const$0008 = ImmutableList.ImmutableList$from$factory([]); 14017 var const$0008 = ImmutableList.ImmutableList$from$factory([]);
13982 var $globals = {}; 14018 var $globals = {};
13983 $static_init(); 14019 $static_init();
13984 main(); 14020 main();
OLDNEW
« no previous file with comments | « frog/lib/corelib_impl.dart ('k') | frog/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698