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(); |
}); |