| 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 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The infrastructure used for (localized) message reporting in V8. | 5 // The infrastructure used for (localized) message reporting in V8. |
| 6 // | 6 // |
| 7 // Note: there's a big unresolved issue about ownership of the data | 7 // Note: there's a big unresolved issue about ownership of the data |
| 8 // structures used by this framework. | 8 // structures used by this framework. |
| 9 | 9 |
| 10 #ifndef V8_MESSAGES_H_ | 10 #ifndef V8_MESSAGES_H_ |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 | 728 |
| 729 | 729 |
| 730 // A message handler is a convenience interface for accessing the list | 730 // A message handler is a convenience interface for accessing the list |
| 731 // of message listeners registered in an environment | 731 // of message listeners registered in an environment |
| 732 class MessageHandler { | 732 class MessageHandler { |
| 733 public: | 733 public: |
| 734 // Returns a message object for the API to use. | 734 // Returns a message object for the API to use. |
| 735 static Handle<JSMessageObject> MakeMessageObject( | 735 static Handle<JSMessageObject> MakeMessageObject( |
| 736 Isolate* isolate, MessageTemplate::Template type, | 736 Isolate* isolate, MessageTemplate::Template type, |
| 737 const MessageLocation* location, Handle<Object> argument, | 737 const MessageLocation* location, Handle<Object> argument, |
| 738 Handle<JSArray> stack_frames); | 738 Handle<FixedArray> stack_frames); |
| 739 | 739 |
| 740 // Report a formatted message (needs JS allocation). | 740 // Report a formatted message (needs JS allocation). |
| 741 static void ReportMessage(Isolate* isolate, const MessageLocation* loc, | 741 static void ReportMessage(Isolate* isolate, const MessageLocation* loc, |
| 742 Handle<JSMessageObject> message); | 742 Handle<JSMessageObject> message); |
| 743 | 743 |
| 744 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, | 744 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, |
| 745 Handle<Object> message_obj); | 745 Handle<Object> message_obj); |
| 746 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 746 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
| 747 static std::unique_ptr<char[]> GetLocalizedMessage(Isolate* isolate, | 747 static std::unique_ptr<char[]> GetLocalizedMessage(Isolate* isolate, |
| 748 Handle<Object> data); | 748 Handle<Object> data); |
| 749 | 749 |
| 750 private: | 750 private: |
| 751 static void ReportMessageNoExceptions(Isolate* isolate, | 751 static void ReportMessageNoExceptions(Isolate* isolate, |
| 752 const MessageLocation* loc, | 752 const MessageLocation* loc, |
| 753 Handle<Object> message_obj, | 753 Handle<Object> message_obj, |
| 754 v8::Local<v8::Value> api_exception_obj); | 754 v8::Local<v8::Value> api_exception_obj); |
| 755 }; | 755 }; |
| 756 | 756 |
| 757 | 757 |
| 758 } // namespace internal | 758 } // namespace internal |
| 759 } // namespace v8 | 759 } // namespace v8 |
| 760 | 760 |
| 761 #endif // V8_MESSAGES_H_ | 761 #endif // V8_MESSAGES_H_ |
| OLD | NEW |