Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 | 81 |
| 82 static void DefaultMessageReport(Isolate* isolate, | 82 static void DefaultMessageReport(Isolate* isolate, |
| 83 const MessageLocation* loc, | 83 const MessageLocation* loc, |
| 84 Handle<Object> message_obj); | 84 Handle<Object> message_obj); |
| 85 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 85 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
| 86 static SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 86 static SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
| 87 Handle<Object> data); | 87 Handle<Object> data); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 | 90 |
| 91 class CallSite { | |
| 92 public: | |
| 93 CallSite(Handle<Object> receiver, Handle<JSFunction> fun, int pos) | |
| 94 : receiver_(receiver), fun_(fun), pos_(pos) {} | |
| 95 | |
| 96 Handle<Object> GetFileName(Isolate* isolate); | |
| 97 Handle<Object> GetFunctionName(Isolate* isolate); | |
| 98 Handle<Object> GetScriptNameOrSourceUrl(Isolate* isolate); | |
| 99 int GetLineNumber(Isolate* isolate); | |
|
Jakob Kummerow
2015/04/27 12:18:22
To prevent future confusion, let's add a comment s
| |
| 100 int GetColumnNumber(Isolate* isolate); | |
| 101 bool IsNative(Isolate* isolate); | |
| 102 bool IsToplevel(Isolate* isolate); | |
| 103 bool IsEval(Isolate* isolate); | |
| 104 | |
| 105 private: | |
| 106 Handle<Object> receiver_; | |
| 107 Handle<JSFunction> fun_; | |
| 108 int pos_; | |
| 109 }; | |
| 110 | |
| 111 | |
| 91 #define MESSAGE_TEMPLATES(T) \ | 112 #define MESSAGE_TEMPLATES(T) \ |
| 92 /* Error */ \ | 113 /* Error */ \ |
| 93 T(CyclicProto, "Cyclic __proto__ value") \ | 114 T(CyclicProto, "Cyclic __proto__ value") \ |
| 94 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \ | 115 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \ |
| 95 T(Unsupported, "Not supported") \ | 116 T(Unsupported, "Not supported") \ |
| 96 T(WrongServiceType, "Internal error, wrong service type: %") \ | 117 T(WrongServiceType, "Internal error, wrong service type: %") \ |
| 97 T(WrongValueType, "Internal error. Wrong value type.") \ | 118 T(WrongValueType, "Internal error. Wrong value type.") \ |
| 98 /* TypeError */ \ | 119 /* TypeError */ \ |
| 99 T(ApplyNonFunction, \ | 120 T(ApplyNonFunction, \ |
| 100 "Function.prototype.apply was called on %, which is a % and not a " \ | 121 "Function.prototype.apply was called on %, which is a % and not a " \ |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 }; | 215 }; |
| 195 | 216 |
| 196 static MaybeHandle<String> FormatMessage(int template_index, | 217 static MaybeHandle<String> FormatMessage(int template_index, |
| 197 Handle<String> arg0, | 218 Handle<String> arg0, |
| 198 Handle<String> arg1, | 219 Handle<String> arg1, |
| 199 Handle<String> arg2); | 220 Handle<String> arg2); |
| 200 }; | 221 }; |
| 201 } } // namespace v8::internal | 222 } } // namespace v8::internal |
| 202 | 223 |
| 203 #endif // V8_MESSAGES_H_ | 224 #endif // V8_MESSAGES_H_ |
| OLD | NEW |