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

Unified Diff: runtime/bin/builtin.cc

Issue 8380020: Refactor the dart api a bit: (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
« no previous file with comments | « no previous file | runtime/bin/builtin_in.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.cc
===================================================================
--- runtime/bin/builtin.cc (revision 775)
+++ runtime/bin/builtin.cc (working copy)
@@ -12,9 +12,11 @@
// test/debug functionality in standalone dart mode.
void PrintString(FILE* out, Dart_Handle str) {
- Dart_Result result = Dart_StringToCString(str);
- const char* cstring = Dart_IsValidResult(result) ?
- Dart_GetResultAsCString(result) : Dart_GetErrorCString(result);
+ const char* cstring = NULL;
+ Dart_Handle result = Dart_StringToCString(str, &cstring);
+ if (!Dart_IsValid(result)) {
+ cstring = Dart_GetError(result);
+ }
fprintf(out, "%s\n", cstring);
fflush(out);
}
« no previous file with comments | « no previous file | runtime/bin/builtin_in.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698