| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 T(DataCloneErrorSharedArrayBufferNotTransferred, \ | 642 T(DataCloneErrorSharedArrayBufferNotTransferred, \ |
| 643 "A SharedArrayBuffer could not be cloned. SharedArrayBuffer must be " \ | 643 "A SharedArrayBuffer could not be cloned. SharedArrayBuffer must be " \ |
| 644 "transferred.") \ | 644 "transferred.") \ |
| 645 T(DataCloneDeserializationError, "Unable to deserialize cloned data.") \ | 645 T(DataCloneDeserializationError, "Unable to deserialize cloned data.") \ |
| 646 T(DataCloneDeserializationVersionError, \ | 646 T(DataCloneDeserializationVersionError, \ |
| 647 "Unable to deserialize cloned data due to invalid or unsupported " \ | 647 "Unable to deserialize cloned data due to invalid or unsupported " \ |
| 648 "version.") | 648 "version.") |
| 649 | 649 |
| 650 class MessageTemplate { | 650 class MessageTemplate { |
| 651 public: | 651 public: |
| 652 enum Template { | 652 enum Template : unsigned { |
| 653 #define TEMPLATE(NAME, STRING) k##NAME, | 653 #define TEMPLATE(NAME, STRING) k##NAME, |
| 654 MESSAGE_TEMPLATES(TEMPLATE) | 654 MESSAGE_TEMPLATES(TEMPLATE) |
| 655 #undef TEMPLATE | 655 #undef TEMPLATE |
| 656 kLastMessage | 656 kLastMessage |
| 657 }; | 657 }; |
| 658 | 658 |
| 659 static const char* TemplateString(int template_index); | 659 static const char* TemplateString(int template_index); |
| 660 | 660 |
| 661 static MaybeHandle<String> FormatMessage(int template_index, | 661 static MaybeHandle<String> FormatMessage(int template_index, |
| 662 Handle<String> arg0, | 662 Handle<String> arg0, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 687 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 687 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
| 688 static std::unique_ptr<char[]> GetLocalizedMessage(Isolate* isolate, | 688 static std::unique_ptr<char[]> GetLocalizedMessage(Isolate* isolate, |
| 689 Handle<Object> data); | 689 Handle<Object> data); |
| 690 }; | 690 }; |
| 691 | 691 |
| 692 | 692 |
| 693 } // namespace internal | 693 } // namespace internal |
| 694 } // namespace v8 | 694 } // namespace v8 |
| 695 | 695 |
| 696 #endif // V8_MESSAGES_H_ | 696 #endif // V8_MESSAGES_H_ |
| OLD | NEW |