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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart

Issue 2653253002: Use microtasks in dart.async (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/js/legacy/dart_sdk.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart
index a88138bab1b07aaf4b95cf1014194da0bdbeb3c1..d06de04821bc13e905667643d832cb1b51c503a2 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart
@@ -42,12 +42,13 @@ async_(gen, T, @rest args) => JS('', '''(() => {
// Checks if the awaited value is a Future.
let future = ret.value;
if (!$instanceOf(future, ${getGenericClass(Future)})) {
- future = $Future.value(future);
+ var result = future;
Jennifer Messerly 2017/01/25 18:31:17 as noted, this change appears to contradict the sp
+ future = $Future.microtask(() => result);
}
// Chain the Future so `await` receives the Future's value.
return future.then($dynamic)(onValue, {onError: onError});
}
- return ${getGenericClass(Future)}($T).new(function() {
+ return ${getGenericClass(Future)}($T).microtask(function() {
Jennifer Messerly 2017/01/25 18:31:17 here's the spec for the return value, 16.14 Functi
iter = $gen.apply(null, $args)[Symbol.iterator]();
return onValue();
});
« no previous file with comments | « pkg/dev_compiler/lib/js/legacy/dart_sdk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698