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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 const String& message = String::Handle(isolate, String::New(error)); 807 const String& message = String::Handle(isolate, String::New(error));
808 return Api::NewHandle(isolate, ApiError::New(message)); 808 return Api::NewHandle(isolate, ApiError::New(message));
809 } 809 }
810 810
811 811
812 DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception) { 812 DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception) {
813 Isolate* isolate = Isolate::Current(); 813 Isolate* isolate = Isolate::Current();
814 DARTSCOPE(isolate); 814 DARTSCOPE(isolate);
815 CHECK_CALLBACK_STATE(isolate); 815 CHECK_CALLBACK_STATE(isolate);
816 816
817 const Instance& obj = Api::UnwrapInstanceHandle(isolate, exception); 817 Instance& obj = Instance::Handle(isolate);
818 if (obj.IsNull()) { 818 if (Dart_IsApiError(exception) || Dart_IsCompilationError(exception)) {
819 RETURN_TYPE_ERROR(isolate, exception, Instance); 819 obj = String::New(Dart_GetError(exception));
820 } else {
821 obj = Api::UnwrapInstanceHandle(isolate, exception).raw();
822 if (obj.IsNull()) {
823 RETURN_TYPE_ERROR(isolate, exception, Instance);
824 }
820 } 825 }
821 const Stacktrace& stacktrace = Stacktrace::Handle(isolate); 826 const Stacktrace& stacktrace = Stacktrace::Handle(isolate);
822 return Api::NewHandle(isolate, UnhandledException::New(obj, stacktrace)); 827 return Api::NewHandle(isolate, UnhandledException::New(obj, stacktrace));
823 } 828 }
824 829
825 830
826 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle) { 831 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle) {
827 Isolate* isolate = Isolate::Current(); 832 Isolate* isolate = Isolate::Current();
828 { 833 {
829 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle)); 834 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
(...skipping 4951 matching lines...) Expand 10 before | Expand all | Expand 10 after
5781 ASSERT(stream != NULL); 5786 ASSERT(stream != NULL);
5782 TimelineEvent* event = stream->StartEvent(); 5787 TimelineEvent* event = stream->StartEvent();
5783 if (event != NULL) { 5788 if (event != NULL) {
5784 event->AsyncEnd(label, async_id); 5789 event->AsyncEnd(label, async_id);
5785 event->Complete(); 5790 event->Complete();
5786 } 5791 }
5787 return Api::Success(); 5792 return Api::Success();
5788 } 5793 }
5789 5794
5790 } // namespace dart 5795 } // namespace dart
OLDNEW
« 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