Index: pkg/http/lib/src/utils.dart |
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart |
index 6a801e194097fd05441b96ba35804b5b1c8a42de..d3a4307620121714b3ce208744703ce43c7534d4 100644 |
--- a/pkg/http/lib/src/utils.dart |
+++ b/pkg/http/lib/src/utils.dart |
@@ -9,6 +9,8 @@ import 'dart:convert'; |
import 'dart:io'; |
import 'dart:typed_data'; |
+import 'package:stack_trace/stack_trace.dart'; |
+ |
import 'byte_stream.dart'; |
/// Converts a URL query string (or `application/x-www-form-urlencoded` body) |
@@ -213,3 +215,6 @@ Future forEachFuture(Iterable input, Future fn(element)) { |
} |
return nextElement(null); |
} |
+ |
+/// Like [Future.sync], but wraps the Future in [Chain.track] as well. |
+Future syncFuture(callback()) => Chain.track(new Future.sync(callback)); |
Bob Nystrom
2013/12/05 17:35:46
Maybe this should be added to stack_trace itself?
nweiz
2013/12/05 19:27:45
I don't want to make it part of the public API sin
|