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

Unified Diff: pkg/dev_compiler/lib/js/es6/dart_sdk.js

Issue 2696133005: Add generic types to Future.forEach in DDC sdk (Closed)
Patch Set: Created 3 years, 10 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:
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/js/common/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/es6/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/es6/dart_sdk.js b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
index 8e04bfc1d75c8383b38b0de694a111126c50aec1..fb17de21cc96f41a55b3937b736a145f3397a0f6 100644
--- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
@@ -19092,12 +19092,14 @@ async.Future$ = dart.flattenFutures(dart.generic(T => {
return completer.future;
};
}
- static forEach(input, f) {
- let iterator = input[dartx.iterator];
- return async.Future.doWhile(dart.fn(() => {
- if (!dart.test(iterator.moveNext())) return false;
- return async.Future.sync(dart.fn(() => dart.dcall(f, iterator.current), VoidTodynamic())).then(core.bool)(dart.fn(_ => true, dynamicTobool()));
- }, VoidToObject()));
+ static forEach(T) {
+ return (input, f) => {
+ let iterator = input[dartx.iterator];
+ return async.Future.doWhile(dart.fn(() => {
+ if (!dart.test(iterator.moveNext())) return false;
+ return async.Future.sync(dart.fn(() => f(iterator.current), VoidTodynamic())).then(core.bool)(dart.fn(_ => true, dynamicTobool()));
+ }, VoidToObject()));
+ };
}
static doWhile(f) {
let doneSignal = new async._Future();
@@ -19127,7 +19129,7 @@ async.Future$ = dart.flattenFutures(dart.generic(T => {
statics: () => ({
wait: dart.definiteFunctionType(T => [async.Future$(core.List$(T)), [core.Iterable$(async.Future$(T))], {eagerError: core.bool, cleanUp: dart.functionType(dart.void, [T])}]),
any: dart.definiteFunctionType(T => [async.Future$(T), [core.Iterable$(async.Future$(T))]]),
- forEach: dart.definiteFunctionType(async.Future, [core.Iterable, dynamicTodynamic()]),
+ forEach: dart.definiteFunctionType(T => [async.Future, [core.Iterable$(T), dart.functionType(dart.dynamic, [T])]]),
doWhile: dart.definiteFunctionType(async.Future, [VoidTodynamic()])
}),
names: ['wait', 'any', 'forEach', 'doWhile']
« no previous file with comments | « pkg/dev_compiler/lib/js/common/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698