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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 8401010: Add DART_CHECKVALID (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 778)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -27,6 +27,7 @@
namespace dart {
siva 2011/10/27 21:15:54 extra new line?
turnidge 2011/10/27 21:55:20 Fixed.
+
DART_EXPORT bool Dart_IsValid(const Dart_Handle& handle) {
ASSERT(Isolate::Current() != NULL);
Zone zone; // Setup a VM zone as we are creating some handles.
@@ -37,6 +38,20 @@
return !obj.IsApiFailure();
}
+
+DART_EXPORT void _Dart_ReportInvalidHandle(bool fatal,
+ const char* file,
+ int line,
+ const char* handle,
+ const char* message) {
+ fprintf(stderr, "%s:%d: invalid handle: '%s':\n '%s'\n",
+ file, line, handle, message);
+ if (fatal) {
+ OS::Abort();
+ }
+}
+
+
DART_EXPORT const char* Dart_GetError(const Dart_Handle& handle) {
ASSERT(Isolate::Current() != NULL);
Zone zone; // Setup a VM zone as we are creating some handles.
@@ -56,8 +71,8 @@
}
-DART_EXPORT Dart_Handle Dart_Error(const char* value) {
- return Api::Error(value);
+DART_EXPORT Dart_Handle Dart_Error(const char* error) {
+ return Api::Error(error);
}

Powered by Google App Engine
This is Rietveld 408576698