Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 for (int i = 0; i < args.Length(); i++) { | 68 for (int i = 0; i < args.Length(); i++) { |
| 69 if (i != 0) printf(" "); | 69 if (i != 0) printf(" "); |
| 70 v8::HandleScope scope; | 70 v8::HandleScope scope; |
| 71 v8::Handle<v8::Value> arg = args[i]; | 71 v8::Handle<v8::Value> arg = args[i]; |
| 72 v8::Handle<v8::String> string_obj = arg->ToString(); | 72 v8::Handle<v8::String> string_obj = arg->ToString(); |
| 73 if (string_obj.IsEmpty()) return string_obj; | 73 if (string_obj.IsEmpty()) return string_obj; |
| 74 int length = string_obj->Length(); | 74 int length = string_obj->Length(); |
| 75 uint16_t* string = NewArray<uint16_t>(length + 1); | 75 uint16_t* string = NewArray<uint16_t>(length + 1); |
| 76 string_obj->Write(string); | 76 string_obj->Write(string); |
| 77 for (int j = 0; j < length; j++) | 77 for (int j = 0; j < length; j++) |
| 78 printf("%lc", static_cast<wint_t>(string[j])); | 78 printf("%u", static_cast<wint_t>(string[j])); |
|
Sven Panne
2011/09/05 11:39:36
This changes the output: Now we print the characte
Jakob Kummerow
2011/09/05 15:05:45
Done.
| |
| 79 DeleteArray(string); | 79 DeleteArray(string); |
| 80 } | 80 } |
| 81 printf("\n"); | 81 printf("\n"); |
| 82 return v8::Undefined(); | 82 return v8::Undefined(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 | 85 |
| 86 static PrintExtension kPrintExtension; | 86 static PrintExtension kPrintExtension; |
| 87 v8::DeclareExtension kPrintExtensionDeclaration(&kPrintExtension); | 87 v8::DeclareExtension kPrintExtensionDeclaration(&kPrintExtension); |
| 88 | 88 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 CompileRun("function f() { a = 12345678 }; f();"); | 396 CompileRun("function f() { a = 12345678 }; f();"); |
| 397 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 397 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 398 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 398 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
| 399 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 399 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 400 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 400 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
| 401 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 401 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 402 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 402 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
| 403 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 403 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
| 404 } | 404 } |
| 405 #endif | 405 #endif |
| OLD | NEW |