Reviewers: Jakob,

Description:
Fix printf formatting in test-compiler.


[email protected]
BUG=v8:2319


Please review this at https://chromiumcodereview.appspot.com/10928182/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M test/cctest/test-compiler.cc


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();


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to