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

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

Side-by-side diff isn't available for this file because of its large size.
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 | « no previous file | pkg/dev_compiler/lib/js/common/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/amd/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/amd/dart_sdk.js b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
index b6da6fe94b83b59071f73e131a3fc186a5e93925..9ebee569f20a4427c3dcf3d0400900605a4c570f 100644
--- a/pkg/dev_compiler/lib/js/amd/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
@@ -19094,12 +19094,14 @@ define([], function() {
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 @@ define([], function() {
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 | « no previous file | pkg/dev_compiler/lib/js/common/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698