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

Unified Diff: pkg/unittest/lib/src/core_matchers.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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/scheduled_test/test/value_future_test.dart ('k') | pkg/unittest/lib/src/future_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/core_matchers.dart
diff --git a/pkg/unittest/lib/src/core_matchers.dart b/pkg/unittest/lib/src/core_matchers.dart
index 1a8143c7a21ce115188c5fae0e9331d22c4c1595..e8606aa45dd4c431ecafafe7e229a18d1d83aac9 100644
--- a/pkg/unittest/lib/src/core_matchers.dart
+++ b/pkg/unittest/lib/src/core_matchers.dart
@@ -326,16 +326,17 @@ class Throws extends BaseMatcher {
// completes.
item.then((value) {
done(() => fail("Expected future to fail, but succeeded with '$value'."));
- }, onError: (e) {
+ }, onError: (error) {
done(() {
if (_matcher == null) return;
var reason;
- if (e.stackTrace != null) {
- var stackTrace = e.stackTrace.toString();
+ var trace = getAttachedStackTrace(error);
+ if (trace != null) {
+ var stackTrace = trace.toString();
stackTrace = " ${stackTrace.replaceAll("\n", "\n ")}";
reason = "Actual exception trace:\n$stackTrace";
}
- expect(e.error, _matcher, reason: reason);
+ expect(error, _matcher, reason: reason);
});
});
// It hasn't failed yet.
« no previous file with comments | « pkg/scheduled_test/test/value_future_test.dart ('k') | pkg/unittest/lib/src/future_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698