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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 T(ApplyNonFunction, \ | 124 T(ApplyNonFunction, \ |
125 "Function.prototype.apply was called on %, which is a % and not a " \ | 125 "Function.prototype.apply was called on %, which is a % and not a " \ |
126 "function") \ | 126 "function") \ |
127 T(ArrayFunctionsOnFrozen, "Cannot modify frozen array elements") \ | 127 T(ArrayFunctionsOnFrozen, "Cannot modify frozen array elements") \ |
128 T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \ | 128 T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \ |
129 T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \ | 129 T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \ |
130 T(CalledNonCallable, "% is not a function") \ | 130 T(CalledNonCallable, "% is not a function") \ |
131 T(CalledOnNonObject, "% called on non-object") \ | 131 T(CalledOnNonObject, "% called on non-object") \ |
132 T(CalledOnNullOrUndefined, "% called on null or undefined") \ | 132 T(CalledOnNullOrUndefined, "% called on null or undefined") \ |
133 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \ | 133 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \ |
134 T(CannotPreventExtExternalArray, \ | |
135 "Cannot prevent extension of an object with external array elements") \ | |
136 T(CircularStructure, "Converting circular structure to JSON") \ | |
137 T(ConstAssign, "Assignment to constant variable.") \ | |
138 T(ConstructorNonCallable, \ | 134 T(ConstructorNonCallable, \ |
139 "Class constructors cannot be invoked without 'new'") \ | 135 "Class constructors cannot be invoked without 'new'") \ |
140 T(ConstructorNotFunction, "Constructor % requires 'new'") \ | 136 T(ConstructorNotFunction, "Constructor % requires 'new'") \ |
141 T(CurrencyCode, "Currency code is required with currency style.") \ | 137 T(CurrencyCode, "Currency code is required with currency style.") \ |
142 T(DataViewNotArrayBuffer, \ | 138 T(DataViewNotArrayBuffer, \ |
143 "First argument to DataView constructor must be an ArrayBuffer") \ | 139 "First argument to DataView constructor must be an ArrayBuffer") \ |
144 T(DateType, "this is not a Date object.") \ | 140 T(DateType, "this is not a Date object.") \ |
145 T(DefineDisallowed, "Cannot define property:%, object is not extensible.") \ | 141 T(DefineDisallowed, "Cannot define property:%, object is not extensible.") \ |
146 T(DuplicateTemplateProperty, "Object template has duplicate property '%'") \ | |
147 T(ExtendsValueGenerator, \ | |
148 "Class extends value % may not be a generator function") \ | |
149 T(ExtendsValueNotFunction, \ | |
150 "Class extends value % is not a function or null") \ | |
151 T(FirstArgumentNotRegExp, \ | 142 T(FirstArgumentNotRegExp, \ |
152 "First argument to % must not be a regular expression") \ | 143 "First argument to % must not be a regular expression") \ |
153 T(FlagsGetterNonObject, \ | 144 T(FlagsGetterNonObject, \ |
154 "RegExp.prototype.flags getter called on non-object %") \ | 145 "RegExp.prototype.flags getter called on non-object %") \ |
155 T(FunctionBind, "Bind must be called on a function") \ | 146 T(FunctionBind, "Bind must be called on a function") \ |
156 T(GeneratorRunning, "Generator is already running") \ | 147 T(GeneratorRunning, "Generator is already running") \ |
157 T(IllegalInvocation, "Illegal invocation") \ | |
158 T(IncompatibleMethodReceiver, "Method % called on incompatible receiver %") \ | 148 T(IncompatibleMethodReceiver, "Method % called on incompatible receiver %") \ |
159 T(InstanceofFunctionExpected, \ | 149 T(InstanceofFunctionExpected, \ |
160 "Expecting a function in instanceof check, but got %") \ | 150 "Expecting a function in instanceof check, but got %") \ |
161 T(InstanceofNonobjectProto, \ | 151 T(InstanceofNonobjectProto, \ |
162 "Function has non-object prototype '%' in instanceof check") \ | 152 "Function has non-object prototype '%' in instanceof check") \ |
163 T(InvalidArgument, "invalid_argument") \ | 153 T(InvalidArgument, "invalid_argument") \ |
164 T(InvalidInOperatorUse, "Cannot use 'in' operator to search for '%' in %") \ | 154 T(InvalidInOperatorUse, "Cannot use 'in' operator to search for '%' in %") \ |
165 T(IteratorResultNotAnObject, "Iterator result % is not an object") \ | 155 T(IteratorResultNotAnObject, "Iterator result % is not an object") \ |
166 T(IteratorValueNotAnObject, "Iterator value % is not an entry object") \ | 156 T(IteratorValueNotAnObject, "Iterator value % is not an entry object") \ |
167 T(LanguageID, "Language ID should be string or object.") \ | 157 T(LanguageID, "Language ID should be string or object.") \ |
168 T(MethodCalledOnWrongObject, \ | 158 T(MethodCalledOnWrongObject, \ |
169 "Method % called on a non-object or on a wrong type of object.") \ | 159 "Method % called on a non-object or on a wrong type of object.") \ |
170 T(MethodInvokedOnNullOrUndefined, \ | 160 T(MethodInvokedOnNullOrUndefined, \ |
171 "Method invoked on undefined or null value.") \ | 161 "Method invoked on undefined or null value.") \ |
172 T(MethodInvokedOnWrongType, "Method invoked on an object that is not %.") \ | 162 T(MethodInvokedOnWrongType, "Method invoked on an object that is not %.") \ |
173 T(NonExtensibleProto, "% is not extensible") \ | |
174 T(NonObjectPropertyLoad, "Cannot read property '%' of %") \ | |
175 T(NonObjectPropertyStore, "Cannot set property '%' of %") \ | |
176 T(NoSetterInCallback, "Cannot set property % of % which has only a getter") \ | |
177 T(NotAnIterator, "% is not an iterator") \ | 163 T(NotAnIterator, "% is not an iterator") \ |
178 T(NotAPromise, "% is not a promise") \ | 164 T(NotAPromise, "% is not a promise") \ |
179 T(NotConstructor, "% is not a constructor") \ | 165 T(NotConstructor, "% is not a constructor") \ |
180 T(NotDateObject, "this is not a Date object.") \ | |
181 T(NotIntlObject, "% is not an i18n object.") \ | |
182 T(NotGeneric, "% is not generic") \ | 166 T(NotGeneric, "% is not generic") \ |
183 T(NotIterable, "% is not iterable") \ | 167 T(NotIterable, "% is not iterable") \ |
184 T(NotTypedArray, "this is not a typed array.") \ | 168 T(NotTypedArray, "this is not a typed array.") \ |
185 T(ObjectGetterExpectingFunction, \ | 169 T(ObjectGetterExpectingFunction, \ |
186 "Object.prototype.__defineGetter__: Expecting function") \ | 170 "Object.prototype.__defineGetter__: Expecting function") \ |
187 T(ObjectGetterCallable, "Getter must be a function: %") \ | 171 T(ObjectGetterCallable, "Getter must be a function: %") \ |
188 T(ObjectNotExtensible, "Can't add property %, object is not extensible") \ | |
189 T(ObjectSetterExpectingFunction, \ | 172 T(ObjectSetterExpectingFunction, \ |
190 "Object.prototype.__defineSetter__: Expecting function") \ | 173 "Object.prototype.__defineSetter__: Expecting function") \ |
191 T(ObjectSetterCallable, "Setter must be a function: %") \ | 174 T(ObjectSetterCallable, "Setter must be a function: %") \ |
192 T(ObserveCallbackFrozen, \ | 175 T(ObserveCallbackFrozen, \ |
193 "Object.observe cannot deliver to a frozen function object") \ | 176 "Object.observe cannot deliver to a frozen function object") \ |
194 T(ObserveGlobalProxy, "% cannot be called on the global proxy object") \ | 177 T(ObserveGlobalProxy, "% cannot be called on the global proxy object") \ |
195 T(ObserveInvalidAccept, \ | 178 T(ObserveInvalidAccept, \ |
196 "Third argument to Object.observe must be an array of strings.") \ | 179 "Third argument to Object.observe must be an array of strings.") \ |
197 T(ObserveNonFunction, "Object.% cannot deliver to non-function") \ | 180 T(ObserveNonFunction, "Object.% cannot deliver to non-function") \ |
198 T(ObserveNonObject, "Object.% cannot % non-object") \ | 181 T(ObserveNonObject, "Object.% cannot % non-object") \ |
199 T(ObserveNotifyNonNotifier, "notify called on non-notifier object") \ | 182 T(ObserveNotifyNonNotifier, "notify called on non-notifier object") \ |
200 T(ObservePerformNonFunction, "Cannot perform non-function") \ | 183 T(ObservePerformNonFunction, "Cannot perform non-function") \ |
201 T(ObservePerformNonString, "Invalid non-string changeType") \ | 184 T(ObservePerformNonString, "Invalid non-string changeType") \ |
202 T(ObserveTypeNonString, \ | 185 T(ObserveTypeNonString, \ |
203 "Invalid changeRecord with non-string 'type' property") \ | 186 "Invalid changeRecord with non-string 'type' property") \ |
204 T(OrdinaryFunctionCalledAsConstructor, \ | 187 T(OrdinaryFunctionCalledAsConstructor, \ |
205 "Function object that's not a constructor was created with new") \ | 188 "Function object that's not a constructor was created with new") \ |
206 T(PromiseCyclic, "Chaining cycle detected for promise %") \ | 189 T(PromiseCyclic, "Chaining cycle detected for promise %") \ |
207 T(PropertyDescObject, "Property description must be an object: %") \ | 190 T(PropertyDescObject, "Property description must be an object: %") \ |
208 T(PropertyNotFunction, "Property '%' of object % is not a function") \ | 191 T(PropertyNotFunction, "Property '%' of object % is not a function") \ |
209 T(ProtoObjectOrNull, "Object prototype may only be an Object or null: %") \ | 192 T(ProtoObjectOrNull, "Object prototype may only be an Object or null: %") \ |
210 T(PrototypeParentNotAnObject, \ | |
211 "Class extends value does not have valid prototype property %") \ | |
212 T(ProxyHandlerDeleteFailed, \ | |
213 "Proxy handler % did not return a boolean value from 'delete' trap") \ | |
214 T(ProxyHandlerNonObject, "Proxy.% called with non-object as handler") \ | 193 T(ProxyHandlerNonObject, "Proxy.% called with non-object as handler") \ |
215 T(ProxyHandlerReturned, "Proxy handler % returned % from '%' trap") \ | 194 T(ProxyHandlerReturned, "Proxy handler % returned % from '%' trap") \ |
216 T(ProxyHandlerTrapMissing, "Proxy handler % has no '%' trap") \ | 195 T(ProxyHandlerTrapMissing, "Proxy handler % has no '%' trap") \ |
217 T(ProxyHandlerTrapMustBeCallable, \ | 196 T(ProxyHandlerTrapMustBeCallable, \ |
218 "Proxy handler %0 has non-callable '%' trap") \ | 197 "Proxy handler %0 has non-callable '%' trap") \ |
219 T(ProxyNonObjectPropNames, "Trap '%' returned non-object %") \ | 198 T(ProxyNonObjectPropNames, "Trap '%' returned non-object %") \ |
220 T(ProxyProtoNonObject, "Proxy.create called with no-object as prototype") \ | 199 T(ProxyProtoNonObject, "Proxy.create called with no-object as prototype") \ |
221 T(ProxyPropNotConfigurable, \ | 200 T(ProxyPropNotConfigurable, \ |
222 "Proxy handler % returned non-configurable descriptor for property '%' " \ | 201 "Proxy handler % returned non-configurable descriptor for property '%' " \ |
223 "from '%' trap") \ | 202 "from '%' trap") \ |
224 T(ProxyRepeatedPropName, "Trap '%' returned repeated property name '%'") \ | 203 T(ProxyRepeatedPropName, "Trap '%' returned repeated property name '%'") \ |
225 T(ProxyTrapFunctionExpected, \ | 204 T(ProxyTrapFunctionExpected, \ |
226 "Proxy.createFunction called with non-function for '%' trap") \ | 205 "Proxy.createFunction called with non-function for '%' trap") \ |
227 T(RedefineDisallowed, "Cannot redefine property: %") \ | 206 T(RedefineDisallowed, "Cannot redefine property: %") \ |
228 T(RedefineExternalArray, \ | |
229 "Cannot redefine a property of an object with external array elements") \ | |
230 T(ReduceNoInitial, "Reduce of empty array with no initial value") \ | 207 T(ReduceNoInitial, "Reduce of empty array with no initial value") \ |
231 T(ReinitializeIntl, "Trying to re-initialize % object.") \ | 208 T(ReinitializeIntl, "Trying to re-initialize % object.") \ |
232 T(ResolvedOptionsCalledOnNonObject, \ | 209 T(ResolvedOptionsCalledOnNonObject, \ |
233 "resolvedOptions method called on a non-object or on a object that is " \ | 210 "resolvedOptions method called on a non-object or on a object that is " \ |
234 "not Intl.%.") \ | 211 "not Intl.%.") \ |
235 T(ResolverNotAFunction, "Promise resolver % is not a function") \ | 212 T(ResolverNotAFunction, "Promise resolver % is not a function") \ |
236 T(RestrictedFunctionProperties, \ | |
237 "'caller' and 'arguments' are restricted function properties and cannot " \ | |
238 "be accessed in this context.") \ | |
239 T(StaticPrototype, "Classes may not have static property named prototype") \ | |
240 T(StrictCannotAssign, "Cannot assign to read only '% in strict mode") \ | |
241 T(StrictDeleteProperty, "Cannot delete property '%' of %") \ | |
242 T(StrictPoisonPill, \ | |
243 "'caller', 'callee', and 'arguments' properties may not be accessed on " \ | |
244 "strict mode functions or the arguments objects for calls to them") \ | |
245 T(StrictReadOnlyProperty, "Cannot assign to read only property '%' of %") \ | |
246 T(StrongImplicitCast, "In strong mode, implicit conversions are deprecated") \ | |
247 T(SymbolToPrimitive, \ | 213 T(SymbolToPrimitive, \ |
248 "Cannot convert a Symbol wrapper object to a primitive value") \ | 214 "Cannot convert a Symbol wrapper object to a primitive value") \ |
249 T(SymbolToNumber, "Cannot convert a Symbol value to a number") \ | 215 T(SymbolToNumber, "Cannot convert a Symbol value to a number") \ |
250 T(SymbolToString, "Cannot convert a Symbol value to a string") \ | 216 T(SymbolToString, "Cannot convert a Symbol value to a string") \ |
251 T(UndefinedOrNullToObject, "Cannot convert undefined or null to object") \ | 217 T(UndefinedOrNullToObject, "Cannot convert undefined or null to object") \ |
252 T(ValueAndAccessor, \ | 218 T(ValueAndAccessor, \ |
253 "Invalid property. A property cannot both have accessors and be " \ | 219 "Invalid property. A property cannot both have accessors and be " \ |
254 "writable or have a value, %") \ | 220 "writable or have a value, %") \ |
255 T(VarRedeclaration, "Identifier '%' has already been declared") \ | |
256 T(WithExpression, "% has no properties") \ | 221 T(WithExpression, "% has no properties") \ |
257 T(WrongArgs, "%: Arguments list has wrong type") \ | 222 T(WrongArgs, "%: Arguments list has wrong type") \ |
258 /* ReferenceError */ \ | 223 /* ReferenceError */ \ |
259 T(NonMethod, "'super' is referenced from non-method") \ | 224 T(NonMethod, "'super' is referenced from non-method") \ |
260 T(NotDefined, "% is not defined") \ | 225 T(NotDefined, "% is not defined") \ |
261 T(UnsupportedSuper, "Unsupported reference to 'super'") \ | 226 T(UnsupportedSuper, "Unsupported reference to 'super'") \ |
262 /* RangeError */ \ | 227 /* RangeError */ \ |
263 T(ArrayLengthOutOfRange, "defineProperty() array length out of range") \ | 228 T(ArrayLengthOutOfRange, "defineProperty() array length out of range") \ |
264 T(DateRange, "Provided date is not in valid range.") \ | 229 T(DateRange, "Provided date is not in valid range.") \ |
265 T(ExpectedLocation, "Expected Area/Location for time zone, got %") \ | 230 T(ExpectedLocation, "Expected Area/Location for time zone, got %") \ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 }; | 271 }; |
307 | 272 |
308 static MaybeHandle<String> FormatMessage(int template_index, | 273 static MaybeHandle<String> FormatMessage(int template_index, |
309 Handle<String> arg0, | 274 Handle<String> arg0, |
310 Handle<String> arg1, | 275 Handle<String> arg1, |
311 Handle<String> arg2); | 276 Handle<String> arg2); |
312 }; | 277 }; |
313 } } // namespace v8::internal | 278 } } // namespace v8::internal |
314 | 279 |
315 #endif // V8_MESSAGES_H_ | 280 #endif // V8_MESSAGES_H_ |
OLD | NEW |