OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 // This method is only meant to be called from gdb for debugging purposes. | 697 // This method is only meant to be called from gdb for debugging purposes. |
698 // Since the string can also be in two-byte encoding, non-ASCII characters | 698 // Since the string can also be in two-byte encoding, non-ASCII characters |
699 // will be ignored in the output. | 699 // will be ignored in the output. |
700 char* String::ToAsciiArray() { | 700 char* String::ToAsciiArray() { |
701 // Static so that subsequent calls frees previously allocated space. | 701 // Static so that subsequent calls frees previously allocated space. |
702 // This also means that previous results will be overwritten. | 702 // This also means that previous results will be overwritten. |
703 static char* buffer = NULL; | 703 static char* buffer = NULL; |
704 if (buffer != NULL) free(buffer); | 704 if (buffer != NULL) free(buffer); |
705 buffer = new char[length()+1]; | 705 buffer = new char[length()+1]; |
706 WriteToFlat(this, buffer, 0, length()); | 706 WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length()); |
707 buffer[length()] = 0; | 707 buffer[length()] = 0; |
708 return buffer; | 708 return buffer; |
709 } | 709 } |
710 | 710 |
711 | 711 |
712 static const char* const weekdays[] = { | 712 static const char* const weekdays[] = { |
713 "???", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" | 713 "???", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" |
714 }; | 714 }; |
715 | 715 |
716 void JSDate::JSDatePrint(FILE* out) { | 716 void JSDate::JSDatePrint(FILE* out) { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 } | 1115 } |
1116 } | 1116 } |
1117 PrintF(out, "\n"); | 1117 PrintF(out, "\n"); |
1118 } | 1118 } |
1119 | 1119 |
1120 | 1120 |
1121 #endif // OBJECT_PRINT | 1121 #endif // OBJECT_PRINT |
1122 | 1122 |
1123 | 1123 |
1124 } } // namespace v8::internal | 1124 } } // namespace v8::internal |
OLD | NEW |