| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 Handle<Object> arg); | 425 Handle<Object> arg); |
| 426 }; | 426 }; |
| 427 | 427 |
| 428 | 428 |
| 429 // A message handler is a convenience interface for accessing the list | 429 // A message handler is a convenience interface for accessing the list |
| 430 // of message listeners registered in an environment | 430 // of message listeners registered in an environment |
| 431 class MessageHandler { | 431 class MessageHandler { |
| 432 public: | 432 public: |
| 433 // Returns a message object for the API to use. | 433 // Returns a message object for the API to use. |
| 434 static Handle<JSMessageObject> MakeMessageObject( | 434 static Handle<JSMessageObject> MakeMessageObject( |
| 435 Isolate* isolate, MessageTemplate::Template type, MessageLocation* loc, | 435 Isolate* isolate, MessageTemplate::Template type, |
| 436 Handle<Object> argument, Handle<JSArray> stack_frames); | 436 MessageLocation* location, Handle<Object> argument, |
| 437 Handle<JSArray> stack_frames); |
| 437 | 438 |
| 438 // Report a formatted message (needs JS allocation). | 439 // Report a formatted message (needs JS allocation). |
| 439 static void ReportMessage(Isolate* isolate, MessageLocation* loc, | 440 static void ReportMessage(Isolate* isolate, MessageLocation* loc, |
| 440 Handle<JSMessageObject> message); | 441 Handle<JSMessageObject> message); |
| 441 | 442 |
| 442 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, | 443 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, |
| 443 Handle<Object> message_obj); | 444 Handle<Object> message_obj); |
| 444 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 445 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
| 445 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 446 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
| 446 Handle<Object> data); | 447 Handle<Object> data); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 482 |
| 482 static MUST_USE_RESULT MaybeHandle<String> GetStringifiedProperty( | 483 static MUST_USE_RESULT MaybeHandle<String> GetStringifiedProperty( |
| 483 Isolate* isolate, LookupIterator* property_lookup, | 484 Isolate* isolate, LookupIterator* property_lookup, |
| 484 Handle<String> default_value); | 485 Handle<String> default_value); |
| 485 | 486 |
| 486 List<Handle<JSObject> > visited_; | 487 List<Handle<JSObject> > visited_; |
| 487 }; | 488 }; |
| 488 } } // namespace v8::internal | 489 } } // namespace v8::internal |
| 489 | 490 |
| 490 #endif // V8_MESSAGES_H_ | 491 #endif // V8_MESSAGES_H_ |
| OLD | NEW |