Index: pkg/shelf/lib/src/util.dart |
diff --git a/pkg/shelf/lib/src/util.dart b/pkg/shelf/lib/src/util.dart |
index bb4847c4872f07d61f191a66a9ef2d775427f87f..b668177a011a4bee288b7421a8c14c746cc6200d 100644 |
--- a/pkg/shelf/lib/src/util.dart |
+++ b/pkg/shelf/lib/src/util.dart |
@@ -8,6 +8,10 @@ import 'dart:async'; |
import 'package:stack_trace/stack_trace.dart'; |
+/// Like [new Future], but avoids around issue 11911 by using [new Future.value] |
+/// under the covers. |
+Future newFuture(callback()) => new Future.value().then((_) => callback()); |
+ |
/// Like [Future.sync], but wraps the Future in [Chain.track] as well. |
Future syncFuture(callback()) => Chain.track(new Future.sync(callback)); |