V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
message-template.h
1 // Copyright 2018 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_MESSAGE_TEMPLATE_H_
6 #define V8_MESSAGE_TEMPLATE_H_
7 
8 #include "src/base/logging.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 #define MESSAGE_TEMPLATES(T) \
14  /* Error */ \
15  T(None, "") \
16  T(CyclicProto, "Cyclic __proto__ value") \
17  T(Debugger, "Debugger: %") \
18  T(DebuggerLoading, "Error loading debugger") \
19  T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \
20  T(DeletePrivateField, "Private fields can not be deleted") \
21  T(UncaughtException, "Uncaught %") \
22  T(Unsupported, "Not supported") \
23  T(WrongServiceType, "Internal error, wrong service type: %") \
24  T(WrongValueType, "Internal error. Wrong value type.") \
25  T(IcuError, "Internal error. Icu error.") \
26  /* TypeError */ \
27  T(ApplyNonFunction, \
28  "Function.prototype.apply was called on %, which is a % and not a " \
29  "function") \
30  T(ArgumentsDisallowedInInitializer, \
31  "'arguments' is not allowed in class field initializer") \
32  T(ArrayBufferTooShort, \
33  "Derived ArrayBuffer constructor created a buffer which was too small") \
34  T(ArrayBufferSpeciesThis, \
35  "ArrayBuffer subclass returned this from species constructor") \
36  T(ArrayItemNotType, "array %[%] is not type %") \
37  T(AwaitNotInAsyncFunction, "await is only valid in async function") \
38  T(AtomicsWaitNotAllowed, "Atomics.wait cannot be called in this context") \
39  T(BadSortComparisonFunction, \
40  "The comparison function must be either a function or undefined") \
41  T(BigIntFromNumber, \
42  "The number % cannot be converted to a BigInt because it is not an " \
43  "integer") \
44  T(BigIntFromObject, "Cannot convert % to a BigInt") \
45  T(BigIntMixedTypes, \
46  "Cannot mix BigInt and other types, use explicit conversions") \
47  T(BigIntSerializeJSON, "Do not know how to serialize a BigInt") \
48  T(BigIntShr, "BigInts have no unsigned right shift, use >> instead") \
49  T(BigIntToNumber, "Cannot convert a BigInt value to a number") \
50  T(CalledNonCallable, "% is not a function") \
51  T(CalledOnNonObject, "% called on non-object") \
52  T(CalledOnNullOrUndefined, "% called on null or undefined") \
53  T(CallSiteExpectsFunction, \
54  "CallSite expects wasm object as first or function as second argument, " \
55  "got <%, %>") \
56  T(CallSiteMethod, "CallSite method % expects CallSite as receiver") \
57  T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \
58  T(CannotPreventExt, "Cannot prevent extensions") \
59  T(CannotFreeze, "Cannot freeze") \
60  T(CannotFreezeArrayBufferView, \
61  "Cannot freeze array buffer views with elements") \
62  T(CannotSeal, "Cannot seal") \
63  T(CircularStructure, "Converting circular structure to JSON") \
64  T(ConstructAbstractClass, "Abstract class % not directly constructable") \
65  T(ConstAssign, "Assignment to constant variable.") \
66  T(ConstructorClassField, "Classes may not have a field named 'constructor'") \
67  T(ConstructorNonCallable, \
68  "Class constructor % cannot be invoked without 'new'") \
69  T(ConstructorNotFunction, "Constructor % requires 'new'") \
70  T(ConstructorNotReceiver, "The .constructor property is not an object") \
71  T(CurrencyCode, "Currency code is required with currency style.") \
72  T(CyclicModuleDependency, "Detected cycle while resolving name '%' in '%'") \
73  T(DataViewNotArrayBuffer, \
74  "First argument to DataView constructor must be an ArrayBuffer") \
75  T(DateType, "this is not a Date object.") \
76  T(DebuggerFrame, "Debugger: Invalid frame index.") \
77  T(DebuggerType, "Debugger: Parameters have wrong types.") \
78  T(DeclarationMissingInitializer, "Missing initializer in % declaration") \
79  T(DefineDisallowed, "Cannot define property %, object is not extensible") \
80  T(DetachedOperation, "Cannot perform % on a detached ArrayBuffer") \
81  T(DuplicateTemplateProperty, "Object template has duplicate property '%'") \
82  T(ExtendsValueNotConstructor, \
83  "Class extends value % is not a constructor or null") \
84  T(FirstArgumentNotRegExp, \
85  "First argument to % must not be a regular expression") \
86  T(FunctionBind, "Bind must be called on a function") \
87  T(GeneratorRunning, "Generator is already running") \
88  T(IllegalInvocation, "Illegal invocation") \
89  T(ImmutablePrototypeSet, \
90  "Immutable prototype object '%' cannot have their prototype set") \
91  T(ImportCallNotNewExpression, "Cannot use new with import") \
92  T(ImportMetaOutsideModule, "Cannot use 'import.meta' outside a module") \
93  T(ImportMissingSpecifier, "import() requires a specifier") \
94  T(IncompatibleMethodReceiver, "Method % called on incompatible receiver %") \
95  T(InstanceofNonobjectProto, \
96  "Function has non-object prototype '%' in instanceof check") \
97  T(InvalidArgument, "invalid_argument") \
98  T(InvalidInOperatorUse, "Cannot use 'in' operator to search for '%' in %") \
99  T(InvalidRegExpExecResult, \
100  "RegExp exec method returned something other than an Object or null") \
101  T(InvalidUnit, "Invalid unit argument for %() '%'") \
102  T(IteratorResultNotAnObject, "Iterator result % is not an object") \
103  T(IteratorSymbolNonCallable, "Found non-callable @@iterator") \
104  T(IteratorValueNotAnObject, "Iterator value % is not an entry object") \
105  T(LanguageID, "Language ID should be string or object.") \
106  T(LocaleNotEmpty, \
107  "First argument to Intl.Locale constructor can't be empty or missing") \
108  T(LocaleBadParameters, "Incorrect locale information provided") \
109  T(ListFormatBadParameters, "Incorrect ListFormat information provided") \
110  T(MapperFunctionNonCallable, "flatMap mapper function is not callable") \
111  T(MethodCalledOnWrongObject, \
112  "Method % called on a non-object or on a wrong type of object.") \
113  T(MethodInvokedOnNullOrUndefined, \
114  "Method invoked on undefined or null value.") \
115  T(MethodInvokedOnWrongType, "Method invoked on an object that is not %.") \
116  T(NoAccess, "no access") \
117  T(NonCallableInInstanceOfCheck, \
118  "Right-hand side of 'instanceof' is not callable") \
119  T(NonCoercible, "Cannot destructure 'undefined' or 'null'.") \
120  T(NonCoercibleWithProperty, \
121  "Cannot destructure property `%` of 'undefined' or 'null'.") \
122  T(NonExtensibleProto, "% is not extensible") \
123  T(NonObjectInInstanceOfCheck, \
124  "Right-hand side of 'instanceof' is not an object") \
125  T(NonObjectPropertyLoad, "Cannot read property '%' of %") \
126  T(NonObjectPropertyStore, "Cannot set property '%' of %") \
127  T(NoSetterInCallback, "Cannot set property % of % which has only a getter") \
128  T(NotAnIterator, "% is not an iterator") \
129  T(NotAPromise, "% is not a promise") \
130  T(NotConstructor, "% is not a constructor") \
131  T(NotDateObject, "this is not a Date object.") \
132  T(NotGeneric, "% requires that 'this' be a %") \
133  T(NotCallableOrIterable, \
134  "% is not a function or its return value is not iterable") \
135  T(NotCallableOrAsyncIterable, \
136  "% is not a function or its return value is not async iterable") \
137  T(NotFiniteNumber, "Value need to be finite number for %()") \
138  T(NotIterable, "% is not iterable") \
139  T(NotIterableNoSymbolLoad, "% is not iterable (cannot read property %)") \
140  T(NotAsyncIterable, "% is not async iterable") \
141  T(NotPropertyName, "% is not a valid property name") \
142  T(NotTypedArray, "this is not a typed array.") \
143  T(NotSuperConstructor, "Super constructor % of % is not a constructor") \
144  T(NotSuperConstructorAnonymousClass, \
145  "Super constructor % of anonymous class is not a constructor") \
146  T(NotIntegerSharedTypedArray, "% is not an integer shared typed array.") \
147  T(NotInt32SharedTypedArray, "% is not an int32 shared typed array.") \
148  T(ObjectGetterExpectingFunction, \
149  "Object.prototype.__defineGetter__: Expecting function") \
150  T(ObjectGetterCallable, "Getter must be a function: %") \
151  T(ObjectNotExtensible, "Cannot add property %, object is not extensible") \
152  T(ObjectSetterExpectingFunction, \
153  "Object.prototype.__defineSetter__: Expecting function") \
154  T(ObjectSetterCallable, "Setter must be a function: %") \
155  T(OrdinaryFunctionCalledAsConstructor, \
156  "Function object that's not a constructor was created with new") \
157  T(PromiseCyclic, "Chaining cycle detected for promise %") \
158  T(PromiseExecutorAlreadyInvoked, \
159  "Promise executor has already been invoked with non-undefined arguments") \
160  T(PromiseNonCallable, "Promise resolve or reject function is not callable") \
161  T(PropertyDescObject, "Property description must be an object: %") \
162  T(PropertyNotFunction, \
163  "'%' returned for property '%' of object '%' is not a function") \
164  T(ProtoObjectOrNull, "Object prototype may only be an Object or null: %") \
165  T(PrototypeParentNotAnObject, \
166  "Class extends value does not have valid prototype property %") \
167  T(ProxyConstructNonObject, \
168  "'construct' on proxy: trap returned non-object ('%')") \
169  T(ProxyDefinePropertyNonConfigurable, \
170  "'defineProperty' on proxy: trap returned truish for defining " \
171  "non-configurable property '%' which is either non-existant or " \
172  "configurable in the proxy target") \
173  T(ProxyDefinePropertyNonExtensible, \
174  "'defineProperty' on proxy: trap returned truish for adding property '%' " \
175  " to the non-extensible proxy target") \
176  T(ProxyDefinePropertyIncompatible, \
177  "'defineProperty' on proxy: trap returned truish for adding property '%' " \
178  " that is incompatible with the existing property in the proxy target") \
179  T(ProxyDeletePropertyNonConfigurable, \
180  "'deleteProperty' on proxy: trap returned truish for property '%' which " \
181  "is non-configurable in the proxy target") \
182  T(ProxyGetNonConfigurableData, \
183  "'get' on proxy: property '%' is a read-only and " \
184  "non-configurable data property on the proxy target but the proxy " \
185  "did not return its actual value (expected '%' but got '%')") \
186  T(ProxyGetNonConfigurableAccessor, \
187  "'get' on proxy: property '%' is a non-configurable accessor " \
188  "property on the proxy target and does not have a getter function, but " \
189  "the trap did not return 'undefined' (got '%')") \
190  T(ProxyGetOwnPropertyDescriptorIncompatible, \
191  "'getOwnPropertyDescriptor' on proxy: trap returned descriptor for " \
192  "property '%' that is incompatible with the existing property in the " \
193  "proxy target") \
194  T(ProxyGetOwnPropertyDescriptorInvalid, \
195  "'getOwnPropertyDescriptor' on proxy: trap returned neither object nor " \
196  "undefined for property '%'") \
197  T(ProxyGetOwnPropertyDescriptorNonConfigurable, \
198  "'getOwnPropertyDescriptor' on proxy: trap reported non-configurability " \
199  "for property '%' which is either non-existant or configurable in the " \
200  "proxy target") \
201  T(ProxyGetOwnPropertyDescriptorNonExtensible, \
202  "'getOwnPropertyDescriptor' on proxy: trap returned undefined for " \
203  "property '%' which exists in the non-extensible proxy target") \
204  T(ProxyGetOwnPropertyDescriptorUndefined, \
205  "'getOwnPropertyDescriptor' on proxy: trap returned undefined for " \
206  "property '%' which is non-configurable in the proxy target") \
207  T(ProxyGetPrototypeOfInvalid, \
208  "'getPrototypeOf' on proxy: trap returned neither object nor null") \
209  T(ProxyGetPrototypeOfNonExtensible, \
210  "'getPrototypeOf' on proxy: proxy target is non-extensible but the " \
211  "trap did not return its actual prototype") \
212  T(ProxyHandlerOrTargetRevoked, \
213  "Cannot create proxy with a revoked proxy as target or handler") \
214  T(ProxyHasNonConfigurable, \
215  "'has' on proxy: trap returned falsish for property '%' which exists in " \
216  "the proxy target as non-configurable") \
217  T(ProxyHasNonExtensible, \
218  "'has' on proxy: trap returned falsish for property '%' but the proxy " \
219  "target is not extensible") \
220  T(ProxyIsExtensibleInconsistent, \
221  "'isExtensible' on proxy: trap result does not reflect extensibility of " \
222  "proxy target (which is '%')") \
223  T(ProxyNonObject, \
224  "Cannot create proxy with a non-object as target or handler") \
225  T(ProxyOwnKeysMissing, \
226  "'ownKeys' on proxy: trap result did not include '%'") \
227  T(ProxyOwnKeysNonExtensible, \
228  "'ownKeys' on proxy: trap returned extra keys but proxy target is " \
229  "non-extensible") \
230  T(ProxyPreventExtensionsExtensible, \
231  "'preventExtensions' on proxy: trap returned truish but the proxy target " \
232  "is extensible") \
233  T(ProxyPrivate, "Cannot pass private property name to proxy trap") \
234  T(ProxyRevoked, "Cannot perform '%' on a proxy that has been revoked") \
235  T(ProxySetFrozenData, \
236  "'set' on proxy: trap returned truish for property '%' which exists in " \
237  "the proxy target as a non-configurable and non-writable data property " \
238  "with a different value") \
239  T(ProxySetFrozenAccessor, \
240  "'set' on proxy: trap returned truish for property '%' which exists in " \
241  "the proxy target as a non-configurable and non-writable accessor " \
242  "property without a setter") \
243  T(ProxySetPrototypeOfNonExtensible, \
244  "'setPrototypeOf' on proxy: trap returned truish for setting a new " \
245  "prototype on the non-extensible proxy target") \
246  T(ProxyTrapReturnedFalsish, "'%' on proxy: trap returned falsish") \
247  T(ProxyTrapReturnedFalsishFor, \
248  "'%' on proxy: trap returned falsish for property '%'") \
249  T(RedefineDisallowed, "Cannot redefine property: %") \
250  T(RedefineExternalArray, \
251  "Cannot redefine a property of an object with external array elements") \
252  T(ReduceNoInitial, "Reduce of empty array with no initial value") \
253  T(RegExpFlags, \
254  "Cannot supply flags when constructing one RegExp from another") \
255  T(RegExpNonObject, "% getter called on non-object %") \
256  T(RegExpNonRegExp, "% getter called on non-RegExp object") \
257  T(RelativeDateTimeFormatterBadParameters, \
258  "Incorrect RelativeDateTimeFormatter provided") \
259  T(ResolverNotAFunction, "Promise resolver % is not a function") \
260  T(ReturnMethodNotCallable, "The iterator's 'return' method is not callable") \
261  T(SharedArrayBufferTooShort, \
262  "Derived SharedArrayBuffer constructor created a buffer which was too " \
263  "small") \
264  T(SharedArrayBufferSpeciesThis, \
265  "SharedArrayBuffer subclass returned this from species constructor") \
266  T(StaticPrototype, \
267  "Classes may not have a static property named 'prototype'") \
268  T(StrictDeleteProperty, "Cannot delete property '%' of %") \
269  T(StrictPoisonPill, \
270  "'caller', 'callee', and 'arguments' properties may not be accessed on " \
271  "strict mode functions or the arguments objects for calls to them") \
272  T(StrictReadOnlyProperty, \
273  "Cannot assign to read only property '%' of % '%'") \
274  T(StrictCannotCreateProperty, "Cannot create property '%' on % '%'") \
275  T(SymbolIteratorInvalid, \
276  "Result of the Symbol.iterator method is not an object") \
277  T(SymbolAsyncIteratorInvalid, \
278  "Result of the Symbol.asyncIterator method is not an object") \
279  T(SymbolKeyFor, "% is not a symbol") \
280  T(SymbolToNumber, "Cannot convert a Symbol value to a number") \
281  T(SymbolToString, "Cannot convert a Symbol value to a string") \
282  T(ThrowMethodMissing, "The iterator does not provide a 'throw' method.") \
283  T(UndefinedOrNullToObject, "Cannot convert undefined or null to object") \
284  T(ValueAndAccessor, \
285  "Invalid property descriptor. Cannot both specify accessors and a value " \
286  "or writable attribute, %") \
287  T(VarRedeclaration, "Identifier '%' has already been declared") \
288  T(WrongArgs, "%: Arguments list has wrong type") \
289  /* ReferenceError */ \
290  T(NotDefined, "% is not defined") \
291  T(SuperAlreadyCalled, "Super constructor may only be called once") \
292  T(UnsupportedSuper, "Unsupported reference to 'super'") \
293  /* RangeError */ \
294  T(BigIntDivZero, "Division by zero") \
295  T(BigIntNegativeExponent, "Exponent must be positive") \
296  T(BigIntTooBig, "Maximum BigInt size exceeded") \
297  T(DateRange, "Provided date is not in valid range.") \
298  T(ExpectedLocation, \
299  "Expected letters optionally connected with underscores or hyphens for " \
300  "a location, got %") \
301  T(InvalidArrayBufferLength, "Invalid array buffer length") \
302  T(ArrayBufferAllocationFailed, "Array buffer allocation failed") \
303  T(InvalidArrayLength, "Invalid array length") \
304  T(InvalidAtomicAccessIndex, "Invalid atomic access index") \
305  T(InvalidCodePoint, "Invalid code point %") \
306  T(InvalidCountValue, "Invalid count value") \
307  T(InvalidCurrencyCode, "Invalid currency code: %") \
308  T(InvalidDataViewAccessorOffset, \
309  "Offset is outside the bounds of the DataView") \
310  T(InvalidDataViewLength, "Invalid DataView length %") \
311  T(InvalidOffset, "Start offset % is outside the bounds of the buffer") \
312  T(InvalidHint, "Invalid hint: %") \
313  T(InvalidIndex, "Invalid value: not (convertible to) a safe integer") \
314  T(InvalidLanguageTag, "Invalid language tag: %") \
315  T(InvalidWeakMapKey, "Invalid value used as weak map key") \
316  T(InvalidWeakSetValue, "Invalid value used in weak set") \
317  T(InvalidStringLength, "Invalid string length") \
318  T(InvalidTimeValue, "Invalid time value") \
319  T(InvalidTimeZone, "Invalid time zone specified: %") \
320  T(InvalidTypedArrayAlignment, "% of % should be a multiple of %") \
321  T(InvalidTypedArrayIndex, "Invalid typed array index") \
322  T(InvalidTypedArrayLength, "Invalid typed array length: %") \
323  T(IllegalTypeWhileStyleNarrow, \
324  "When style is 'narrow', 'unit' is the only allowed value for the type " \
325  "option.") \
326  T(LetInLexicalBinding, "let is disallowed as a lexically bound name") \
327  T(LocaleMatcher, "Illegal value for localeMatcher:%") \
328  T(NormalizationForm, "The normalization form should be one of %.") \
329  T(ParameterOfFunctionOutOfRange, \
330  "Paramenter % of function %() is % and out of range") \
331  T(ZeroDigitNumericSeparator, \
332  "Numeric separator can not be used after leading 0.") \
333  T(NumberFormatRange, "% argument must be between 0 and 100") \
334  T(TrailingNumericSeparator, \
335  "Numeric separators are not allowed at the end of numeric literals") \
336  T(ContinuousNumericSeparator, \
337  "Only one underscore is allowed as numeric separator") \
338  T(PropertyValueOutOfRange, "% value is out of range.") \
339  T(StackOverflow, "Maximum call stack size exceeded") \
340  T(ToPrecisionFormatRange, \
341  "toPrecision() argument must be between 1 and 100") \
342  T(ToRadixFormatRange, "toString() radix argument must be between 2 and 36") \
343  T(TypedArraySetOffsetOutOfBounds, "offset is out of bounds") \
344  T(TypedArraySetSourceTooLarge, "Source is too large") \
345  T(ValueOutOfRange, "Value % out of range for % options property %") \
346  /* SyntaxError */ \
347  T(AmbiguousExport, \
348  "The requested module '%' contains conflicting star exports for name '%'") \
349  T(BadGetterArity, "Getter must not have any formal parameters.") \
350  T(BadSetterArity, "Setter must have exactly one formal parameter.") \
351  T(BigIntInvalidString, "Invalid BigInt string") \
352  T(ConstructorIsAccessor, "Class constructor may not be an accessor") \
353  T(ConstructorIsGenerator, "Class constructor may not be a generator") \
354  T(ConstructorIsAsync, "Class constructor may not be an async method") \
355  T(ConstructorIsPrivate, "Class constructor may not be a private method") \
356  T(DerivedConstructorReturnedNonObject, \
357  "Derived constructors may only return object or undefined") \
358  T(DuplicateConstructor, "A class may only have one constructor") \
359  T(DuplicateExport, "Duplicate export of '%'") \
360  T(DuplicateProto, \
361  "Duplicate __proto__ fields are not allowed in object literals") \
362  T(ForInOfLoopInitializer, \
363  "% loop variable declaration may not have an initializer.") \
364  T(ForInOfLoopMultiBindings, \
365  "Invalid left-hand side in % loop: Must have a single binding.") \
366  T(GeneratorInSingleStatementContext, \
367  "Generators can only be declared at the top level or inside a block.") \
368  T(AsyncFunctionInSingleStatementContext, \
369  "Async functions can only be declared at the top level or inside a " \
370  "block.") \
371  T(IllegalBreak, "Illegal break statement") \
372  T(NoIterationStatement, \
373  "Illegal continue statement: no surrounding iteration statement") \
374  T(IllegalContinue, \
375  "Illegal continue statement: '%' does not denote an iteration statement") \
376  T(IllegalLanguageModeDirective, \
377  "Illegal '%' directive in function with non-simple parameter list") \
378  T(IllegalReturn, "Illegal return statement") \
379  T(IntrinsicWithSpread, "Intrinsic calls do not support spread arguments") \
380  T(InvalidRestBindingPattern, \
381  "`...` must be followed by an identifier in declaration contexts") \
382  T(InvalidPropertyBindingPattern, "Illegal property in declaration context") \
383  T(InvalidRestAssignmentPattern, \
384  "`...` must be followed by an assignable reference in assignment " \
385  "contexts") \
386  T(InvalidEscapedReservedWord, "Keyword must not contain escaped characters") \
387  T(InvalidEscapedMetaProperty, "'%' must not contain escaped characters") \
388  T(InvalidLhsInAssignment, "Invalid left-hand side in assignment") \
389  T(InvalidCoverInitializedName, "Invalid shorthand property initializer") \
390  T(InvalidDestructuringTarget, "Invalid destructuring assignment target") \
391  T(InvalidLhsInFor, "Invalid left-hand side in for-loop") \
392  T(InvalidLhsInPostfixOp, \
393  "Invalid left-hand side expression in postfix operation") \
394  T(InvalidLhsInPrefixOp, \
395  "Invalid left-hand side expression in prefix operation") \
396  T(InvalidRegExpFlags, "Invalid flags supplied to RegExp constructor '%'") \
397  T(InvalidOrUnexpectedToken, "Invalid or unexpected token") \
398  T(InvalidPrivateFieldAccess, "Invalid private field '%'") \
399  T(JsonParseUnexpectedEOS, "Unexpected end of JSON input") \
400  T(JsonParseUnexpectedToken, "Unexpected token % in JSON at position %") \
401  T(JsonParseUnexpectedTokenNumber, "Unexpected number in JSON at position %") \
402  T(JsonParseUnexpectedTokenString, "Unexpected string in JSON at position %") \
403  T(LabelRedeclaration, "Label '%' has already been declared") \
404  T(LabelledFunctionDeclaration, \
405  "Labelled function declaration not allowed as the body of a control flow " \
406  "structure") \
407  T(MalformedArrowFunParamList, "Malformed arrow function parameter list") \
408  T(MalformedRegExp, "Invalid regular expression: /%/: %") \
409  T(MalformedRegExpFlags, "Invalid regular expression flags") \
410  T(ModuleExportUndefined, "Export '%' is not defined in module") \
411  T(HtmlCommentInModule, "HTML comments are not allowed in modules") \
412  T(MultipleDefaultsInSwitch, \
413  "More than one default clause in switch statement") \
414  T(NewlineAfterThrow, "Illegal newline after throw") \
415  T(NoCatchOrFinally, "Missing catch or finally after try") \
416  T(ParamAfterRest, "Rest parameter must be last formal parameter") \
417  T(FlattenPastSafeLength, \
418  "Flattening % elements on an array-like of length % " \
419  "is disallowed, as the total surpasses 2**53-1") \
420  T(PushPastSafeLength, \
421  "Pushing % elements on an array-like of length % " \
422  "is disallowed, as the total surpasses 2**53-1") \
423  T(ElementAfterRest, "Rest element must be last element") \
424  T(BadSetterRestParameter, \
425  "Setter function argument must not be a rest parameter") \
426  T(ParamDupe, "Duplicate parameter name not allowed in this context") \
427  T(ParenthesisInArgString, "Function arg string contains parenthesis") \
428  T(ArgStringTerminatesParametersEarly, \
429  "Arg string terminates parameters early") \
430  T(UnexpectedEndOfArgString, "Unexpected end of arg string") \
431  T(RestDefaultInitializer, \
432  "Rest parameter may not have a default initializer") \
433  T(RuntimeWrongNumArgs, "Runtime function given wrong number of arguments") \
434  T(SuperNotCalled, \
435  "Must call super constructor in derived class before accessing 'this' or " \
436  "returning from derived constructor") \
437  T(SingleFunctionLiteral, "Single function literal required") \
438  T(SloppyFunction, \
439  "In non-strict mode code, functions can only be declared at top level, " \
440  "inside a block, or as the body of an if statement.") \
441  T(SpeciesNotConstructor, \
442  "object.constructor[Symbol.species] is not a constructor") \
443  T(StrictDelete, "Delete of an unqualified identifier in strict mode.") \
444  T(StrictEvalArguments, "Unexpected eval or arguments in strict mode") \
445  T(StrictFunction, \
446  "In strict mode code, functions can only be declared at top level or " \
447  "inside a block.") \
448  T(StrictOctalLiteral, "Octal literals are not allowed in strict mode.") \
449  T(StrictDecimalWithLeadingZero, \
450  "Decimals with leading zeros are not allowed in strict mode.") \
451  T(StrictOctalEscape, \
452  "Octal escape sequences are not allowed in strict mode.") \
453  T(StrictWith, "Strict mode code may not include a with statement") \
454  T(TemplateOctalLiteral, \
455  "Octal escape sequences are not allowed in template strings.") \
456  T(ThisFormalParameter, "'this' is not a valid formal parameter name") \
457  T(AwaitBindingIdentifier, \
458  "'await' is not a valid identifier name in an async function") \
459  T(AwaitExpressionFormalParameter, \
460  "Illegal await-expression in formal parameters of async function") \
461  T(TooManyArguments, \
462  "Too many arguments in function call (only 65535 allowed)") \
463  T(TooManyParameters, \
464  "Too many parameters in function definition (only 65534 allowed)") \
465  T(TooManySpreads, \
466  "Literal containing too many nested spreads (up to 65534 allowed)") \
467  T(TooManyVariables, "Too many variables declared (only 4194303 allowed)") \
468  T(TooManyElementsInPromiseAll, "Too many elements passed to Promise.all") \
469  T(TypedArrayTooShort, \
470  "Derived TypedArray constructor created an array which was too small") \
471  T(UnexpectedEOS, "Unexpected end of input") \
472  T(UnexpectedReserved, "Unexpected reserved word") \
473  T(UnexpectedStrictReserved, "Unexpected strict mode reserved word") \
474  T(UnexpectedSuper, "'super' keyword unexpected here") \
475  T(UnexpectedNewTarget, "new.target expression is not allowed here") \
476  T(UnexpectedTemplateString, "Unexpected template string") \
477  T(UnexpectedToken, "Unexpected token %") \
478  T(UnexpectedTokenIdentifier, "Unexpected identifier") \
479  T(UnexpectedTokenNumber, "Unexpected number") \
480  T(UnexpectedTokenString, "Unexpected string") \
481  T(UnexpectedTokenRegExp, "Unexpected regular expression") \
482  T(UnexpectedLexicalDeclaration, \
483  "Lexical declaration cannot appear in a single-statement context") \
484  T(UnknownLabel, "Undefined label '%'") \
485  T(UnresolvableExport, \
486  "The requested module '%' does not provide an export named '%'") \
487  T(UnterminatedArgList, "missing ) after argument list") \
488  T(UnterminatedRegExp, "Invalid regular expression: missing /") \
489  T(UnterminatedTemplate, "Unterminated template literal") \
490  T(UnterminatedTemplateExpr, "Missing } in template expression") \
491  T(FoundNonCallableHasInstance, "Found non-callable @@hasInstance") \
492  T(InvalidHexEscapeSequence, "Invalid hexadecimal escape sequence") \
493  T(InvalidUnicodeEscapeSequence, "Invalid Unicode escape sequence") \
494  T(UndefinedUnicodeCodePoint, "Undefined Unicode code-point") \
495  T(YieldInParameter, "Yield expression not allowed in formal parameter") \
496  /* EvalError */ \
497  T(CodeGenFromStrings, "%") \
498  T(NoSideEffectDebugEvaluate, "Possible side-effect in debug-evaluate") \
499  /* URIError */ \
500  T(URIMalformed, "URI malformed") \
501  /* Wasm errors (currently Error) */ \
502  T(WasmTrapUnreachable, "unreachable") \
503  T(WasmTrapMemOutOfBounds, "memory access out of bounds") \
504  T(WasmTrapUnalignedAccess, "operation does not support unaligned accesses") \
505  T(WasmTrapDivByZero, "divide by zero") \
506  T(WasmTrapDivUnrepresentable, "divide result unrepresentable") \
507  T(WasmTrapRemByZero, "remainder by zero") \
508  T(WasmTrapFloatUnrepresentable, "float unrepresentable in integer range") \
509  T(WasmTrapFuncInvalid, "invalid index into function table") \
510  T(WasmTrapFuncSigMismatch, "function signature mismatch") \
511  T(WasmTrapTypeError, "wasm function signature contains illegal type") \
512  T(WasmExceptionError, "wasm exception") \
513  /* Asm.js validation related */ \
514  T(AsmJsInvalid, "Invalid asm.js: %") \
515  T(AsmJsCompiled, "Converted asm.js to WebAssembly: %") \
516  T(AsmJsInstantiated, "Instantiated asm.js: %") \
517  T(AsmJsLinkingFailed, "Linking failure in asm.js: %") \
518  /* DataCloneError messages */ \
519  T(DataCloneError, "% could not be cloned.") \
520  T(DataCloneErrorOutOfMemory, "Data cannot be cloned, out of memory.") \
521  T(DataCloneErrorNeuteredArrayBuffer, \
522  "An ArrayBuffer is neutered and could not be cloned.") \
523  T(DataCloneErrorSharedArrayBufferTransferred, \
524  "A SharedArrayBuffer could not be cloned. SharedArrayBuffer must not be " \
525  "transferred.") \
526  T(DataCloneDeserializationError, "Unable to deserialize cloned data.") \
527  T(DataCloneDeserializationVersionError, \
528  "Unable to deserialize cloned data due to invalid or unsupported " \
529  "version.") \
530  /* Builtins-Trace Errors */ \
531  T(TraceEventCategoryError, "Trace event category must be a string.") \
532  T(TraceEventNameError, "Trace event name must be a string.") \
533  T(TraceEventNameLengthError, \
534  "Trace event name must not be an empty string.") \
535  T(TraceEventPhaseError, "Trace event phase must be a number.") \
536  T(TraceEventIDError, "Trace event id must be a number.") \
537  /* Weak refs */ \
538  T(WeakRefsCleanupMustBeCallable, "WeakFactory: cleanup must be callable") \
539  T(WeakRefsMakeCellTargetMustBeObject, \
540  "WeakFactory.prototype.makeCell: target must be an object") \
541  T(WeakRefsMakeCellTargetAndHoldingsMustNotBeSame, \
542  "WeakFactory.prototype.makeCell: target and holdings must not be same") \
543  T(WeakRefsMakeRefTargetMustBeObject, \
544  "WeakFactory.prototype.makeRef: target must be an object") \
545  T(WeakRefsMakeRefTargetAndHoldingsMustNotBeSame, \
546  "WeakFactory.prototype.makeRef: target and holdings must not be same")
547 
548 enum class MessageTemplate {
549 #define TEMPLATE(NAME, STRING) k##NAME,
550  MESSAGE_TEMPLATES(TEMPLATE)
551 #undef TEMPLATE
552  kLastMessage
553 };
554 
555 inline MessageTemplate MessageTemplateFromInt(int message_id) {
556  DCHECK_LE(0, message_id);
557  DCHECK_LT(message_id, static_cast<int>(MessageTemplate::kLastMessage));
558  return static_cast<MessageTemplate>(message_id);
559 }
560 
561 } // namespace internal
562 } // namespace v8
563 
564 #endif // V8_MESSAGE_TEMPLATE_H_
Definition: libplatform.h:13