Revision: 12499
Author:   [email protected]
Date:     Thu Sep 13 08:06:15 2012
Log:      Fix printf formatting in test-compiler.

[email protected]
BUG=v8:2319

Review URL: https://chromiumcodereview.appspot.com/10928182
http://code.google.com/p/v8/source/detail?r=12499

Modified:
 /branches/bleeding_edge/test/cctest/test-compiler.cc

=======================================
--- /branches/bleeding_edge/test/cctest/test-compiler.cc Tue Aug 28 03:49:23 2012 +++ /branches/bleeding_edge/test/cctest/test-compiler.cc Thu Sep 13 08:06:15 2012
@@ -68,15 +68,9 @@
   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