OLD | NEW |
1 dart_library.library('dart/async', null, /* Imports */[ | 1 dart_library.library('dart/async', null, /* Imports */[ |
2 'dart/_runtime', | 2 'dart/_runtime', |
3 'dart/core', | 3 'dart/core', |
4 'dart/_internal', | 4 'dart/_internal', |
5 'dart/collection' | 5 'dart/collection' |
6 ], /* Lazy imports */[ | 6 ], /* Lazy imports */[ |
7 'dart/_isolate_helper' | 7 'dart/_isolate_helper' |
8 ], function(exports, dart, core, _internal, collection, _isolate_helper) { | 8 ], function(exports, dart, core, _internal, collection, _isolate_helper) { |
9 'use strict'; | 9 'use strict'; |
10 let dartx = dart.dartx; | 10 let dartx = dart.dartx; |
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 return Future$(core.List).value(dart.const([])); | 1886 return Future$(core.List).value(dart.const([])); |
1887 } | 1887 } |
1888 values = core.List.new(remaining); | 1888 values = core.List.new(remaining); |
1889 return result; | 1889 return result; |
1890 } | 1890 } |
1891 static forEach(input, f) { | 1891 static forEach(input, f) { |
1892 let iterator = input[dartx.iterator]; | 1892 let iterator = input[dartx.iterator]; |
1893 return Future$().doWhile(dart.fn(() => { | 1893 return Future$().doWhile(dart.fn(() => { |
1894 if (!dart.notNull(iterator.moveNext())) return false; | 1894 if (!dart.notNull(iterator.moveNext())) return false; |
1895 return Future$().sync(dart.fn(() => dart.dcall(f, iterator.current))).
then(dart.fn(_ => true, core.bool, [dart.dynamic])); | 1895 return Future$().sync(dart.fn(() => dart.dcall(f, iterator.current))).
then(dart.fn(_ => true, core.bool, [dart.dynamic])); |
1896 })); | 1896 }, core.Object, [])); |
1897 } | 1897 } |
1898 static doWhile(f) { | 1898 static doWhile(f) { |
1899 let doneSignal = new _Future(); | 1899 let doneSignal = new _Future(); |
1900 let nextIteration = null; | 1900 let nextIteration = null; |
1901 nextIteration = Zone.current.bindUnaryCallback(dart.fn(keepGoing => { | 1901 nextIteration = Zone.current.bindUnaryCallback(dart.fn(keepGoing => { |
1902 if (dart.notNull(keepGoing)) { | 1902 if (dart.notNull(keepGoing)) { |
1903 Future$().sync(f).then(dart.as(nextIteration, __CastType2), {onError
: dart.bind(doneSignal, _completeError)}); | 1903 Future$().sync(f).then(dart.as(nextIteration, __CastType2), {onError
: dart.bind(doneSignal, _completeError)}); |
1904 } else { | 1904 } else { |
1905 doneSignal[_complete](null); | 1905 doneSignal[_complete](null); |
1906 } | 1906 } |
(...skipping 3872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5779 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; | 5779 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; |
5780 exports.CreateTimerHandler = CreateTimerHandler; | 5780 exports.CreateTimerHandler = CreateTimerHandler; |
5781 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; | 5781 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; |
5782 exports.PrintHandler = PrintHandler; | 5782 exports.PrintHandler = PrintHandler; |
5783 exports.ForkHandler = ForkHandler; | 5783 exports.ForkHandler = ForkHandler; |
5784 exports.ZoneSpecification = ZoneSpecification; | 5784 exports.ZoneSpecification = ZoneSpecification; |
5785 exports.ZoneDelegate = ZoneDelegate; | 5785 exports.ZoneDelegate = ZoneDelegate; |
5786 exports.Zone = Zone; | 5786 exports.Zone = Zone; |
5787 exports.runZoned = runZoned; | 5787 exports.runZoned = runZoned; |
5788 }); | 5788 }); |
OLD | NEW |