Chromium Code Reviews| Index: runtime/vm/dart_api_impl.cc |
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
| index 178db2e18c05c21fbc28d464338d79ed4623afb3..ba99b7d17b29dc307219686b05f197a15c0a4772 100644 |
| --- a/runtime/vm/dart_api_impl.cc |
| +++ b/runtime/vm/dart_api_impl.cc |
| @@ -1264,7 +1264,7 @@ DART_EXPORT const char* Dart_VersionString() { |
| return Version::String(); |
| } |
| -DART_EXPORT bool Dart_Initialize( |
| +DART_EXPORT char* Dart_Initialize( |
| const uint8_t* vm_isolate_snapshot, |
| Dart_IsolateCreateCallback create, |
| Dart_IsolateInterruptCallback interrupt, |
| @@ -1280,21 +1280,19 @@ DART_EXPORT bool Dart_Initialize( |
| file_open, file_read, file_write, |
| file_close, entropy_source); |
| if (err_msg != NULL) { |
| - OS::PrintErr("Dart_Initialize: %s\n", err_msg); |
| - return false; |
| + return strdup(err_msg); |
| } |
| - return true; |
| + return NULL; |
| } |
| -DART_EXPORT bool Dart_Cleanup() { |
| +DART_EXPORT char* Dart_Cleanup() { |
| CHECK_NO_ISOLATE(Isolate::Current()); |
| const char* err_msg = Dart::Cleanup(); |
| if (err_msg != NULL) { |
| - OS::PrintErr("Dart_Cleanup: %s\n", err_msg); |
| - return false; |
| + return strdup(err_msg); |
| } |
| - return true; |
| + return NULL; |
| } |
| @@ -1365,6 +1363,10 @@ DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri, |
| } |
| Isolate* isolate = Dart::CreateIsolate(isolate_name, *flags); |
| free(isolate_name); |
| + if (isolate == NULL) { |
| + *error = strdup("Isolate creation failed"); |
| + return reinterpret_cast<Dart_Isolate>(NULL); |
| + } |
| { |
| StackZone zone(isolate); |
| HANDLESCOPE(isolate); |
| @@ -1671,6 +1673,7 @@ DART_EXPORT Dart_Handle Dart_RunLoop() { |
| Dart_Handle error = Api::NewHandle(isolate, |
| isolate->object_store()->sticky_error()); |
| isolate->object_store()->clear_sticky_error(); |
| + OS::PrintErr("RunLoop returning error\n"); |
|
Ivan Posva
2015/08/17 13:35:51
Debug print left over?
zra
2015/08/18 06:23:14
Removed.
|
| return error; |
| } |
| if (FLAG_print_class_table) { |