Commit 4f47e68a authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix printf formatting in test-compiler.

R=jkummerow@chromium.org
BUG=v8:2319

Review URL: https://chromiumcodereview.appspot.com/10928182

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c037a7fe
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment