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

Unified Diff: test/cctest/test-compiler.cc

Issue 10928182: Fix printf formatting in test-compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-compiler.cc
diff --git a/test/cctest/test-compiler.cc b/test/cctest/test-compiler.cc
index 961c94bff084361fa5957fa2fa12f964e443a5ad..7700a980d2fd0b84232133c2ffc5eea4545ac653 100644
--- a/test/cctest/test-compiler.cc
+++ b/test/cctest/test-compiler.cc
@@ -68,15 +68,9 @@ v8::Handle<v8::Value> PrintExtension::Print(const v8::Arguments& args) {
for (int i = 0; i < args.Length(); i++) {
if (i != 0) printf(" ");
v8::HandleScope scope;
- v8::Handle<v8::Value> arg = args[i];
- v8::Handle<v8::String> string_obj = arg->ToString();
- if (string_obj.IsEmpty()) return string_obj;
- int length = string_obj->Length();
- uint16_t* string = NewArray<uint16_t>(length + 1);
- string_obj->Write(string);
- for (int j = 0; j < length; j++)
- printf("%lc", static_cast<wchar_t>(string[j]));
- DeleteArray(string);
+ v8::String::Utf8Value str(args[i]);
+ if (*str == NULL) return v8::Undefined();
+ printf("%s", *str);
}
printf("\n");
return v8::Undefined();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698