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

Unified Diff: pkg/dev_compiler/lib/js/common/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/amd/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/es6/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/common/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/common/dart_sdk.js b/pkg/dev_compiler/lib/js/common/dart_sdk.js
index 674993a1a37d40b1ccda02700465db71af65d846..e3131b9352e129ff8f473dedc4397a51e2a597b7 100644
--- a/pkg/dev_compiler/lib/js/common/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/common/dart_sdk.js
@@ -19094,12 +19094,14 @@
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();
@@ -19129,7 +19131,7 @@
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/amd/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/es6/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698