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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 8501034: Deal with unhandled exceptions the same way in all Dart api functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
===================================================================
--- runtime/vm/snapshot_test.cc (revision 1469)
+++ runtime/vm/snapshot_test.cc (working copy)
@@ -368,7 +368,6 @@
0,
NULL);
EXPECT_VALID(result);
- EXPECT(!Dart_ExceptionOccurred(result));
Dart_ExitScope(); // Exit the Dart API scope.
}
@@ -415,7 +414,6 @@
0,
NULL);
EXPECT_VALID(result);
- EXPECT(!Dart_ExceptionOccurred(result));
Dart_ExitScope(); // Exit the Dart API scope.
}
@@ -437,20 +435,11 @@
Dart_NewString("testMain"),
0,
NULL);
- EXPECT_VALID(result);
- if (Dart_ExceptionOccurred(result)) {
- // Print the exception object.
- fprintf(stderr, "An unhandled exception has been thrown\n");
- Dart_Handle exception_result = Dart_GetException(result);
- assert(Dart_IsValid(exception_result));
- const char* obj_cstring = NULL;
- Dart_Handle retstr = Dart_StringToCString(exception_result, &obj_cstring);
- if (!Dart_IsValid(retstr)) {
- obj_cstring = Dart_GetError(retstr);
- }
- fprintf(stderr, "%s", obj_cstring);
+ if (Dart_IsError(result)) {
+ // Print the error. It is probably an unhandled exception.
+ fprintf(stderr, "%s\n", Dart_GetError(result));
}
- EXPECT(!Dart_ExceptionOccurred(result));
+ EXPECT_VALID(result);
Dart_ExitScope(); // Exit the Dart API scope.
}
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698