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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1190413006: Fix line width issue. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address code review comments Created 5 years, 6 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 | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 89a22ce2977bad734f1d1fa0d2aa88f3e2f0d4e7..405954d314094a7918ab4c1952f43b1b02a8f10a 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -814,9 +814,14 @@ DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception) {
DARTSCOPE(isolate);
CHECK_CALLBACK_STATE(isolate);
- const Instance& obj = Api::UnwrapInstanceHandle(isolate, exception);
- if (obj.IsNull()) {
- RETURN_TYPE_ERROR(isolate, exception, Instance);
+ Instance& obj = Instance::Handle(isolate);
+ if (Dart_IsApiError(exception) || Dart_IsCompilationError(exception)) {
+ obj = String::New(Dart_GetError(exception));
+ } else {
+ obj = Api::UnwrapInstanceHandle(isolate, exception).raw();
+ if (obj.IsNull()) {
+ RETURN_TYPE_ERROR(isolate, exception, Instance);
+ }
}
const Stacktrace& stacktrace = Stacktrace::Handle(isolate);
return Api::NewHandle(isolate, UnhandledException::New(obj, stacktrace));
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698