OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 space -= Min(space, strlen(message)); | 889 space -= Min(space, strlen(message)); |
890 p = &buffer[kBufferSize] - space; | 890 p = &buffer[kBufferSize] - space; |
891 | 891 |
892 for (unsigned i = 0; i < ARRAY_SIZE(args); i++) { | 892 for (unsigned i = 0; i < ARRAY_SIZE(args); i++) { |
893 if (space > 0) { | 893 if (space > 0) { |
894 *p++ = ' '; | 894 *p++ = ' '; |
895 space--; | 895 space--; |
896 if (space > 0) { | 896 if (space > 0) { |
897 MaybeObject* maybe_arg = args->GetElement(isolate(), i); | 897 MaybeObject* maybe_arg = args->GetElement(isolate(), i); |
898 Handle<String> arg_str(reinterpret_cast<String*>(maybe_arg)); | 898 Handle<String> arg_str(reinterpret_cast<String*>(maybe_arg)); |
899 const char* arg = *arg_str->ToCString(); | 899 SmartArrayPointer<char> arg = arg_str->ToCString(); |
900 Vector<char> v2(p, static_cast<int>(space)); | 900 Vector<char> v2(p, static_cast<int>(space)); |
901 OS::StrNCpy(v2, arg, space); | 901 OS::StrNCpy(v2, arg.get(), space); |
902 space -= Min(space, strlen(arg)); | 902 space -= Min(space, strlen(arg.get())); |
903 p = &buffer[kBufferSize] - space; | 903 p = &buffer[kBufferSize] - space; |
904 } | 904 } |
905 } | 905 } |
906 } | 906 } |
907 if (space > 0) { | 907 if (space > 0) { |
908 *p = '\0'; | 908 *p = '\0'; |
909 } else { | 909 } else { |
910 buffer[kBufferSize - 1] = '\0'; | 910 buffer[kBufferSize - 1] = '\0'; |
911 } | 911 } |
912 Handle<String> error_string = NewStringFromUtf8(CStrVector(buffer), TENURED); | 912 Handle<String> error_string = NewStringFromUtf8(CStrVector(buffer), TENURED); |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 return Handle<Object>::null(); | 1797 return Handle<Object>::null(); |
1798 } | 1798 } |
1799 | 1799 |
1800 | 1800 |
1801 Handle<Object> Factory::ToBoolean(bool value) { | 1801 Handle<Object> Factory::ToBoolean(bool value) { |
1802 return value ? true_value() : false_value(); | 1802 return value ? true_value() : false_value(); |
1803 } | 1803 } |
1804 | 1804 |
1805 | 1805 |
1806 } } // namespace v8::internal | 1806 } } // namespace v8::internal |
OLD | NEW |