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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 int end_pos_; | 61 int end_pos_; |
62 }; | 62 }; |
63 | 63 |
64 | 64 |
65 // A message handler is a convenience interface for accessing the list | 65 // A message handler is a convenience interface for accessing the list |
66 // of message listeners registered in an environment | 66 // of message listeners registered in an environment |
67 class MessageHandler { | 67 class MessageHandler { |
68 public: | 68 public: |
69 // Returns a message object for the API to use. | 69 // Returns a message object for the API to use. |
70 static Handle<JSMessageObject> MakeMessageObject( | 70 static Handle<JSMessageObject> MakeMessageObject( |
71 Isolate* isolate, | 71 Isolate* isolate, const char* type, MessageLocation* loc, |
72 const char* type, | 72 Vector<Handle<Object> > args, Handle<JSObject> promise, |
73 MessageLocation* loc, | |
74 Vector< Handle<Object> > args, | |
75 Handle<JSArray> stack_frames); | 73 Handle<JSArray> stack_frames); |
76 | 74 |
77 // Report a formatted message (needs JS allocation). | 75 // Report a formatted message (needs JS allocation). |
78 static void ReportMessage(Isolate* isolate, | 76 static void ReportMessage(Isolate* isolate, |
79 MessageLocation* loc, | 77 MessageLocation* loc, |
80 Handle<Object> message); | 78 Handle<Object> message); |
81 | 79 |
82 static void DefaultMessageReport(Isolate* isolate, | 80 static void DefaultMessageReport(Isolate* isolate, |
83 const MessageLocation* loc, | 81 const MessageLocation* loc, |
84 Handle<Object> message_obj); | 82 Handle<Object> message_obj); |
85 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 83 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
86 static SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 84 static SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
87 Handle<Object> data); | 85 Handle<Object> data); |
88 }; | 86 }; |
89 | 87 |
90 } } // namespace v8::internal | 88 } } // namespace v8::internal |
91 | 89 |
92 #endif // V8_MESSAGES_H_ | 90 #endif // V8_MESSAGES_H_ |
OLD | NEW |