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_ |
11 #define V8_MESSAGES_H_ | 11 #define V8_MESSAGES_H_ |
12 | 12 |
13 // Forward declaration of MessageLocation. | 13 #include "src/base/smart-pointers.h" |
14 namespace v8 { | 14 #include "src/list.h" |
15 namespace internal { | |
16 class MessageLocation; | |
17 } } // namespace v8::internal | |
18 | |
19 | |
20 class V8Message { | |
21 public: | |
22 V8Message(char* type, | |
23 v8::internal::Handle<v8::internal::JSArray> args, | |
24 const v8::internal::MessageLocation* loc) : | |
25 type_(type), args_(args), loc_(loc) { } | |
26 char* type() const { return type_; } | |
27 v8::internal::Handle<v8::internal::JSArray> args() const { return args_; } | |
28 const v8::internal::MessageLocation* loc() const { return loc_; } | |
29 private: | |
30 char* type_; | |
31 v8::internal::Handle<v8::internal::JSArray> const args_; | |
32 const v8::internal::MessageLocation* loc_; | |
33 }; | |
34 | |
35 | 15 |
36 namespace v8 { | 16 namespace v8 { |
37 namespace internal { | 17 namespace internal { |
38 | 18 |
39 struct Language; | 19 // Forward declarations. |
| 20 class JSMessageObject; |
| 21 class LookupIterator; |
40 class SourceInfo; | 22 class SourceInfo; |
41 | 23 |
42 class MessageLocation { | 24 class MessageLocation { |
43 public: | 25 public: |
44 MessageLocation(Handle<Script> script, int start_pos, int end_pos, | 26 MessageLocation(Handle<Script> script, int start_pos, int end_pos, |
45 Handle<JSFunction> function = Handle<JSFunction>()) | 27 Handle<JSFunction> function = Handle<JSFunction>()) |
46 : script_(script), | 28 : script_(script), |
47 start_pos_(start_pos), | 29 start_pos_(start_pos), |
48 end_pos_(end_pos), | 30 end_pos_(end_pos), |
49 function_(function) {} | 31 function_(function) {} |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 475 |
494 static MUST_USE_RESULT MaybeHandle<String> GetStringifiedProperty( | 476 static MUST_USE_RESULT MaybeHandle<String> GetStringifiedProperty( |
495 Isolate* isolate, LookupIterator* property_lookup, | 477 Isolate* isolate, LookupIterator* property_lookup, |
496 Handle<String> default_value); | 478 Handle<String> default_value); |
497 | 479 |
498 List<Handle<JSObject> > visited_; | 480 List<Handle<JSObject> > visited_; |
499 }; | 481 }; |
500 } } // namespace v8::internal | 482 } } // namespace v8::internal |
501 | 483 |
502 #endif // V8_MESSAGES_H_ | 484 #endif // V8_MESSAGES_H_ |
OLD | NEW |