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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 Handle<Object> receiver_; | 84 Handle<Object> receiver_; |
85 Handle<JSFunction> fun_; | 85 Handle<JSFunction> fun_; |
86 int pos_; | 86 int pos_; |
87 }; | 87 }; |
88 | 88 |
89 | 89 |
90 #define MESSAGE_TEMPLATES(T) \ | 90 #define MESSAGE_TEMPLATES(T) \ |
91 /* Error */ \ | 91 /* Error */ \ |
92 T(None, "") \ | 92 T(None, "") \ |
93 T(CyclicProto, "Cyclic __proto__ value") \ | 93 T(CyclicProto, "Cyclic __proto__ value") \ |
| 94 T(Debugger, "Debugger: %") \ |
94 T(DebuggerLoading, "Error loading debugger") \ | 95 T(DebuggerLoading, "Error loading debugger") \ |
95 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \ | 96 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \ |
96 T(UncaughtException, "Uncaught %") \ | 97 T(UncaughtException, "Uncaught %") \ |
97 T(Unsupported, "Not supported") \ | 98 T(Unsupported, "Not supported") \ |
98 T(WrongServiceType, "Internal error, wrong service type: %") \ | 99 T(WrongServiceType, "Internal error, wrong service type: %") \ |
99 T(WrongValueType, "Internal error. Wrong value type.") \ | 100 T(WrongValueType, "Internal error. Wrong value type.") \ |
100 /* TypeError */ \ | 101 /* TypeError */ \ |
101 T(ApplyNonFunction, \ | 102 T(ApplyNonFunction, \ |
102 "Function.prototype.apply was called on %, which is a % and not a " \ | 103 "Function.prototype.apply was called on %, which is a % and not a " \ |
103 "function") \ | 104 "function") \ |
104 T(ArrayFunctionsOnFrozen, "Cannot modify frozen array elements") \ | 105 T(ArrayFunctionsOnFrozen, "Cannot modify frozen array elements") \ |
105 T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \ | 106 T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \ |
106 T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \ | 107 T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \ |
107 T(CalledNonCallable, "% is not a function") \ | 108 T(CalledNonCallable, "% is not a function") \ |
108 T(CalledOnNonObject, "% called on non-object") \ | 109 T(CalledOnNonObject, "% called on non-object") \ |
109 T(CalledOnNullOrUndefined, "% called on null or undefined") \ | 110 T(CalledOnNullOrUndefined, "% called on null or undefined") \ |
110 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \ | 111 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \ |
111 T(CannotPreventExtExternalArray, \ | 112 T(CannotPreventExtExternalArray, \ |
112 "Cannot prevent extension of an object with external array elements") \ | 113 "Cannot prevent extension of an object with external array elements") \ |
113 T(CircularStructure, "Converting circular structure to JSON") \ | 114 T(CircularStructure, "Converting circular structure to JSON") \ |
114 T(ConstAssign, "Assignment to constant variable.") \ | 115 T(ConstAssign, "Assignment to constant variable.") \ |
115 T(ConstructorNonCallable, \ | 116 T(ConstructorNonCallable, \ |
116 "Class constructors cannot be invoked without 'new'") \ | 117 "Class constructors cannot be invoked without 'new'") \ |
117 T(ConstructorNotFunction, "Constructor % requires 'new'") \ | 118 T(ConstructorNotFunction, "Constructor % requires 'new'") \ |
118 T(CurrencyCode, "Currency code is required with currency style.") \ | 119 T(CurrencyCode, "Currency code is required with currency style.") \ |
119 T(DataViewNotArrayBuffer, \ | 120 T(DataViewNotArrayBuffer, \ |
120 "First argument to DataView constructor must be an ArrayBuffer") \ | 121 "First argument to DataView constructor must be an ArrayBuffer") \ |
121 T(DateType, "this is not a Date object.") \ | 122 T(DateType, "this is not a Date object.") \ |
| 123 T(DebuggerFrame, "Debugger: Invalid frame index.") \ |
| 124 T(DebuggerType, "Debugger: Parameters have wrong types.") \ |
122 T(DefineDisallowed, "Cannot define property:%, object is not extensible.") \ | 125 T(DefineDisallowed, "Cannot define property:%, object is not extensible.") \ |
123 T(DuplicateTemplateProperty, "Object template has duplicate property '%'") \ | 126 T(DuplicateTemplateProperty, "Object template has duplicate property '%'") \ |
124 T(ExtendsValueGenerator, \ | 127 T(ExtendsValueGenerator, \ |
125 "Class extends value % may not be a generator function") \ | 128 "Class extends value % may not be a generator function") \ |
126 T(ExtendsValueNotFunction, \ | 129 T(ExtendsValueNotFunction, \ |
127 "Class extends value % is not a function or null") \ | 130 "Class extends value % is not a function or null") \ |
128 T(FirstArgumentNotRegExp, \ | 131 T(FirstArgumentNotRegExp, \ |
129 "First argument to % must not be a regular expression") \ | 132 "First argument to % must not be a regular expression") \ |
130 T(FlagsGetterNonObject, \ | 133 T(FlagsGetterNonObject, \ |
131 "RegExp.prototype.flags getter called on non-object %") \ | 134 "RegExp.prototype.flags getter called on non-object %") \ |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 456 |
454 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, | 457 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, |
455 Handle<Object> message_obj); | 458 Handle<Object> message_obj); |
456 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 459 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
457 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 460 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
458 Handle<Object> data); | 461 Handle<Object> data); |
459 }; | 462 }; |
460 } } // namespace v8::internal | 463 } } // namespace v8::internal |
461 | 464 |
462 #endif // V8_MESSAGES_H_ | 465 #endif // V8_MESSAGES_H_ |
OLD | NEW |