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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 9186058: Make the "sticky error" an Error instead of a String. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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/vm/code_generator_x64.cc ('k') | runtime/vm/longjump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 3366)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -67,9 +67,9 @@
} else {
// Make a copy of the error message as the original message string
// may get deallocated when we return back from the Dart API call.
- const String& err =
- String::Handle(isolate->object_store()->sticky_error());
- const char* errmsg = err.ToCString();
+ const Error& err =
+ Error::Handle(isolate->object_store()->sticky_error());
+ const char* errmsg = err.ToErrorCString();
intptr_t errlen = strlen(errmsg) + 1;
char* msg = reinterpret_cast<char*>(Api::Allocate(errlen));
OS::SNPrint(msg, errlen, "%s", errmsg);
@@ -79,12 +79,9 @@
void SetupErrorResult(Dart_Handle* handle) {
- // Make a copy of the error message as the original message string
- // may get deallocated when we return back from the Dart API call.
- const String& error = String::Handle(
+ const Error& error = Error::Handle(
Isolate::Current()->object_store()->sticky_error());
- const Object& obj = Object::Handle(LanguageError::New(error));
- *handle = Api::NewLocalHandle(obj);
+ *handle = Api::NewLocalHandle(error);
}
@@ -516,9 +513,9 @@
} else {
{
DARTSCOPE_NOCHECKS(isolate);
- const String& errmsg =
- String::Handle(isolate->object_store()->sticky_error());
- *error = strdup(errmsg.ToCString());
+ const Error& error_obj =
+ Error::Handle(isolate->object_store()->sticky_error());
+ *error = strdup(error_obj.ToErrorCString());
}
Dart::ShutdownIsolate();
}
« no previous file with comments | « runtime/vm/code_generator_x64.cc ('k') | runtime/vm/longjump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698