| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 25 matching lines...) Expand all Loading... |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 | 38 |
| 39 // If no message listeners have been registered this one is called | 39 // If no message listeners have been registered this one is called |
| 40 // by default. | 40 // by default. |
| 41 void MessageHandler::DefaultMessageReport(Isolate* isolate, | 41 void MessageHandler::DefaultMessageReport(Isolate* isolate, |
| 42 const MessageLocation* loc, | 42 const MessageLocation* loc, |
| 43 Handle<Object> message_obj) { | 43 Handle<Object> message_obj) { |
| 44 SmartArrayPointer<char> str = GetLocalizedMessage(isolate, message_obj); | 44 SmartArrayPointer<char> str = GetLocalizedMessage(isolate, message_obj); |
| 45 if (loc == NULL) { | 45 if (loc == NULL) { |
| 46 PrintF("%s\n", *str); | 46 PrintF("%s\n", str.get()); |
| 47 } else { | 47 } else { |
| 48 HandleScope scope(isolate); | 48 HandleScope scope(isolate); |
| 49 Handle<Object> data(loc->script()->name(), isolate); | 49 Handle<Object> data(loc->script()->name(), isolate); |
| 50 SmartArrayPointer<char> data_str; | 50 SmartArrayPointer<char> data_str; |
| 51 if (data->IsString()) | 51 if (data->IsString()) |
| 52 data_str = Handle<String>::cast(data)->ToCString(DISALLOW_NULLS); | 52 data_str = Handle<String>::cast(data)->ToCString(DISALLOW_NULLS); |
| 53 PrintF("%s:%i: %s\n", *data_str ? *data_str : "<unknown>", | 53 PrintF("%s:%i: %s\n", data_str.get() ? data_str.get() : "<unknown>", |
| 54 loc->start_pos(), *str); | 54 loc->start_pos(), str.get()); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 | 58 |
| 59 Handle<JSMessageObject> MessageHandler::MakeMessageObject( | 59 Handle<JSMessageObject> MessageHandler::MakeMessageObject( |
| 60 Isolate* isolate, | 60 Isolate* isolate, |
| 61 const char* type, | 61 const char* type, |
| 62 MessageLocation* loc, | 62 MessageLocation* loc, |
| 63 Vector< Handle<Object> > args, | 63 Vector< Handle<Object> > args, |
| 64 Handle<String> stack_trace, | 64 Handle<String> stack_trace, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 SmartArrayPointer<char> MessageHandler::GetLocalizedMessage( | 194 SmartArrayPointer<char> MessageHandler::GetLocalizedMessage( |
| 195 Isolate* isolate, | 195 Isolate* isolate, |
| 196 Handle<Object> data) { | 196 Handle<Object> data) { |
| 197 HandleScope scope(isolate); | 197 HandleScope scope(isolate); |
| 198 return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS); | 198 return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS); |
| 199 } | 199 } |
| 200 | 200 |
| 201 | 201 |
| 202 } } // namespace v8::internal | 202 } } // namespace v8::internal |
| OLD | NEW |