5#ifndef V8_COMMON_MESSAGE_TEMPLATE_H_
6#define V8_COMMON_MESSAGE_TEMPLATE_H_
13#define MESSAGE_TEMPLATES(T) \
16 T(ConflictingPrivateName, \
17 "Operation is ambiguous because there are more than one private name" \
18 "'%' on the object") \
19 T(CyclicProto, "Cyclic __proto__ value") \
20 T(Debugger, "Debugger: %") \
21 T(DebuggerLoading, "Error loading debugger") \
22 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \
23 T(DeletePrivateField, "Private fields can not be deleted") \
24 T(PlaceholderOnly, "%") \
25 T(UncaughtException, "Uncaught %") \
26 T(Unsupported, "Not supported") \
27 T(WrongServiceType, "Internal error, wrong service type: %") \
28 T(WrongValueType, "Internal error. Wrong value type.") \
29 T(IcuError, "Internal error. Icu error.") \
32 "Function.prototype.apply was called on %, which is % and not a " \
34 T(ArgumentsDisallowedInInitializerAndStaticBlock, \
35 "'arguments' is not allowed in class field initializer or static " \
36 "initialization block") \
37 T(ArgumentIsNonObject, "% argument must be an object") \
38 T(ArgumentIsNonString, "% argument must be a string") \
39 T(ArrayBufferDetachKeyDoesntMatch, \
40 "Provided key doesn't match [[ArrayBufferDetachKey]]") \
41 T(ArrayBufferTooShort, \
42 "Derived ArrayBuffer constructor created a buffer which was too small") \
43 T(ArrayBufferSpeciesThis, \
44 "ArrayBuffer subclass returned this from species constructor") \
45 T(AwaitNotInAsyncContext, \
46 "await is only valid in async functions and the top level bodies of " \
48 T(AwaitNotInDebugEvaluate, \
49 "await can not be used when evaluating code " \
50 "while paused in the debugger") \
51 T(AtomicsMutexNotOwnedByCurrentThread, \
52 "Atomics.Mutex is not owned by the current agent") \
53 T(AtomicsOperationNotAllowed, "% cannot be called in this context") \
54 T(BadRoundingType, "RoundingType is not fractionDigits") \
55 T(BadSortComparisonFunction, \
56 "The comparison function must be either a function or undefined: %") \
58 "The number % cannot be converted to a BigInt because it is not an " \
60 T(BigIntFromObject, "Cannot convert % to a BigInt") \
62 "Cannot mix BigInt and other types, use explicit conversions") \
63 T(BigIntSerializeJSON, "Do not know how to serialize a BigInt") \
64 T(BigIntShr, "BigInts have no unsigned right shift, use >> instead") \
65 T(BigIntToNumber, "Cannot convert a BigInt value to a number") \
66 T(CalledNonCallable, "% is not a function") \
67 T(CalledOnNonObject, "% called on non-object") \
68 T(CalledOnNullOrUndefined, "% called on null or undefined") \
69 T(CallShadowRealmEvaluateThrew, "ShadowRealm evaluate threw (%)") \
70 T(CallSiteExpectsFunction, \
71 "CallSite expects wasm object as first or function as second argument, " \
73 T(CallSiteMethod, "CallSite method % expects CallSite as receiver") \
74 T(CallSiteMethodUnsupportedInShadowRealm, \
75 "CallSite method % is unsupported inside ShadowRealms") \
76 T(CallWrappedFunctionThrew, "WrappedFunction threw (%)") \
77 T(CannotBeShared, "% cannot be shared") \
78 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \
79 T(CannotPreventExt, "Cannot prevent extensions") \
80 T(CannotFreeze, "Cannot freeze") \
81 T(CannotFreezeArrayBufferView, \
82 "Cannot freeze array buffer views with elements") \
83 T(CannotSeal, "Cannot seal") \
84 T(CannotSealArrayBufferView, "Cannot seal array buffer views with elements") \
85 T(CannotWrap, "Cannot wrap target callable (%)") \
86 T(CircularStructure, "Converting circular structure to JSON%") \
87 T(ConstructAbstractClass, "Abstract class % not directly constructable") \
88 T(ConstAssign, "Assignment to constant variable.") \
89 T(ConstructorClassField, "Classes may not have a field named 'constructor'") \
90 T(ConstructorNonCallable, \
91 "Class constructor % cannot be invoked without 'new'") \
92 T(AnonymousConstructorNonCallable, \
93 "Class constructors cannot be invoked without 'new'") \
94 T(ConstructorNotFunction, "Constructor % requires 'new'") \
95 T(ConstructorNotReceiver, "The .constructor property is not an object") \
96 T(CurrencyCode, "Currency code is required with currency style.") \
97 T(CyclicModuleDependency, "Detected cycle while resolving name '%' in '%'") \
98 T(DataViewNotArrayBuffer, \
99 "First argument to DataView constructor must be an ArrayBuffer") \
100 T(DateType, "this is not a Date object.") \
101 T(DebuggerFrame, "Debugger: Invalid frame index.") \
102 T(DebuggerType, "Debugger: Parameters have wrong types.") \
103 T(DeclarationMissingInitializer, "Missing initializer in % declaration") \
104 T(DefineDisallowed, "Cannot define property %, object is not extensible") \
105 T(DefineDisallowedFixedLayout, \
106 "Cannot define property %, object has fixed layout") \
107 T(DetachedOperation, "Cannot perform % on a detached ArrayBuffer") \
108 T(DoNotUse, "Do not use %; %") \
109 T(DuplicateTemplateProperty, "Object template has duplicate property '%'") \
110 T(ExtendsValueNotConstructor, \
111 "Class extends value % is not a constructor or null") \
112 T(FirstArgumentNotRegExp, \
113 "First argument to % must not be a regular expression") \
114 T(FunctionBind, "Bind must be called on a function") \
115 T(GeneratorRunning, "Generator is already running") \
116 T(IllegalInvocation, "Illegal invocation") \
117 T(ImmutablePrototypeSet, \
118 "Immutable prototype object '%' cannot have their prototype set") \
119 T(ImportAttributesDuplicateKey, "Import attribute has duplicate key '%'") \
120 T(ImportCallNotNewExpression, "Cannot use new with import") \
121 T(ImportOutsideModule, "Cannot use import statement outside a module") \
122 T(ImportMetaOutsideModule, "Cannot use 'import.meta' outside a module") \
123 T(ImportMissingSpecifier, "import() requires a specifier") \
124 T(ImportShadowRealmRejected, "Cannot import in ShadowRealm (%)") \
125 T(IncompatibleMethodReceiver, "Method % called on incompatible receiver %") \
126 T(InstanceofNonobjectProto, \
127 "Function has non-object prototype '%' in instanceof check") \
128 T(InvalidArgument, "invalid_argument") \
129 T(InvalidArgumentForTemporal, "Invalid argument for Temporal %") \
130 T(InvalidOption, "invalid option %") \
131 T(InvalidInOperatorUse, "Cannot use 'in' operator to search for '%' in %") \
132 T(InvalidRawJsonValue, "Invalid value for JSON.rawJSON") \
133 T(InvalidRegExpExecResult, \
134 "RegExp exec method returned something other than an Object or null") \
135 T(InvalidUnit, "Invalid unit argument for %() '%'") \
136 T(IsNotNumber, "Type of '%' must be 'number', found '%'") \
137 T(IterableYieldedNonString, "Iterable yielded % which is not a string") \
138 T(IteratorReduceNoInitial, \
139 "Reduce of a done iterator with no initial value") \
140 T(IteratorResultNotAnObject, "Iterator result % is not an object") \
141 T(SpreadIteratorSymbolNonCallable, \
142 "Spread syntax requires ...iterable[Symbol.iterator] to be a function") \
143 T(FirstArgumentIteratorSymbolNonCallable, \
144 "% requires that the property of the first argument, " \
145 "items[Symbol.iterator], when exists, be a function") \
146 T(FirstArgumentAsyncIteratorSymbolNonCallable, \
147 "% requires that the property of the first argument, " \
148 "items[Symbol.asyncIterator], when exists, be a function") \
149 T(IteratorValueNotAnObject, "Iterator value % is not an entry object") \
150 T(KeysMethodInvalid, "Result of the keys method is not an object") \
151 T(LanguageID, "Language ID should be string or object.") \
153 "First argument to Intl.Locale constructor can't be empty or missing") \
154 T(LocaleBadParameters, "Incorrect locale information provided") \
155 T(ListFormatBadParameters, "Incorrect ListFormat information provided") \
156 T(MapperFunctionNonCallable, "flatMap mapper function is not callable") \
157 T(MethodInvokedOnWrongType, "Method invoked on an object that is not %.") \
158 T(NoAccess, "no access") \
159 T(NonCallableInInstanceOfCheck, \
160 "Right-hand side of 'instanceof' is not callable") \
161 T(NonCoercible, "Cannot destructure '%' as it is %.") \
162 T(NonCoercibleWithProperty, \
163 "Cannot destructure property '%' of '%' as it is %.") \
164 T(NonExtensibleProto, "% is not extensible") \
165 T(NonObjectAttributesOption, "The 'with' option must be an object") \
166 T(NonObjectInInstanceOfCheck, \
167 "Right-hand side of 'instanceof' is not an object") \
168 T(NonObjectPrivateNameAccess, "Cannot access private name % from %") \
169 T(NonObjectPropertyLoad, "Cannot read properties of %") \
170 T(NonObjectPropertyLoadWithProperty, \
171 "Cannot read properties of % (reading '%')") \
172 T(NonObjectPropertyStore, "Cannot set properties of %") \
173 T(NonObjectPropertyStoreWithProperty, \
174 "Cannot set properties of % (setting '%')") \
175 T(NonObjectImportArgument, \
176 "The second argument to import() must be an object") \
177 T(NonStringImportAttributeValue, "Import attribute value must be a string") \
178 T(NoSetterInCallback, "Cannot set property % of % which has only a getter") \
179 T(NotAnIterator, "% is not an iterator") \
180 T(PromiseNewTargetUndefined, \
181 "Promise constructor cannot be invoked without 'new'") \
182 T(NotConstructor, "% is not a constructor") \
183 T(NotDateObject, "this is not a Date object.") \
184 T(NotGeneric, "% requires that 'this' be a %") \
185 T(NotCallable, "% is not a function") \
186 T(NotCallableOrIterable, \
187 "% is not a function or its return value is not iterable") \
188 T(NotCallableOrAsyncIterable, \
189 "% is not a function or its return value is not async iterable") \
190 T(NotFiniteNumber, "Value need to be finite number for %()") \
191 T(NotIterable, "% is not iterable") \
192 T(NotIterableNoSymbolLoad, "% is not iterable (cannot read property %)") \
193 T(NotAsyncIterable, "% is not async iterable") \
194 T(NotPropertyName, "% is not a valid property name") \
195 T(NotTypedArray, "this is not a typed array.") \
196 T(NotSuperConstructor, "Super constructor % of % is not a constructor") \
197 T(NotSuperConstructorAnonymousClass, \
198 "Super constructor % of anonymous class is not a constructor") \
199 T(NotIntegerTypedArray, "% is not an integer typed array.") \
200 T(NotInt32OrBigInt64TypedArray, \
201 "% is not an int32 or BigInt64 typed array.") \
202 T(NotSharedTypedArray, "% is not a shared typed array.") \
203 T(ObjectFixedLayout, "Cannot add property %, object has fixed layout") \
204 T(ObjectGetterExpectingFunction, \
205 "Object.prototype.__defineGetter__: Expecting function") \
206 T(ObjectGetterCallable, "Getter must be a function: %") \
207 T(ObjectNotExtensible, "Cannot add property %, object is not extensible") \
208 T(ObjectSetterExpectingFunction, \
209 "Object.prototype.__defineSetter__: Expecting function") \
210 T(ObjectSetterCallable, "Setter must be a function: %") \
211 T(OrdinaryFunctionCalledAsConstructor, \
212 "Function object that's not a constructor was created with new") \
213 T(PromiseCyclic, "Chaining cycle detected for promise %") \
214 T(PromiseExecutorAlreadyInvoked, \
215 "Promise executor has already been invoked with non-undefined arguments") \
216 T(PromiseNonCallable, "Promise resolve or reject function is not callable") \
217 T(PropertyDescObject, "Property description must be an object: %") \
218 T(PropertyNotFunction, \
219 "'%' returned for property '%' of object '%' is not a function") \
220 T(ProtoObjectOrNull, "Object prototype may only be an Object or null: %") \
221 T(PrototypeParentNotAnObject, \
222 "Class extends value does not have valid prototype property %") \
223 T(ProxyConstructNonObject, \
224 "'construct' on proxy: trap returned non-object ('%')") \
225 T(ProxyDefinePropertyNonConfigurable, \
226 "'defineProperty' on proxy: trap returned truish for defining " \
227 "non-configurable property '%' which is either non-existent or " \
228 "configurable in the proxy target") \
229 T(ProxyDefinePropertyNonConfigurableWritable, \
230 "'defineProperty' on proxy: trap returned truish for defining " \
231 "non-configurable property '%' which cannot be non-writable, unless " \
232 "there exists a corresponding non-configurable, non-writable own " \
233 "property of the target object.") \
234 T(ProxyDefinePropertyNonExtensible, \
235 "'defineProperty' on proxy: trap returned truish for adding property '%' " \
236 " to the non-extensible proxy target") \
237 T(ProxyDefinePropertyIncompatible, \
238 "'defineProperty' on proxy: trap returned truish for adding property '%' " \
239 " that is incompatible with the existing property in the proxy target") \
240 T(ProxyDeletePropertyNonConfigurable, \
241 "'deleteProperty' on proxy: trap returned truish for property '%' which " \
242 "is non-configurable in the proxy target") \
243 T(ProxyDeletePropertyNonExtensible, \
244 "'deleteProperty' on proxy: trap returned truish for property '%' but " \
245 "the proxy target is non-extensible") \
246 T(ProxyGetNonConfigurableData, \
247 "'get' on proxy: property '%' is a read-only and " \
248 "non-configurable data property on the proxy target but the proxy " \
249 "did not return its actual value (expected '%' but got '%')") \
250 T(ProxyGetNonConfigurableAccessor, \
251 "'get' on proxy: property '%' is a non-configurable accessor " \
252 "property on the proxy target and does not have a getter function, but " \
253 "the trap did not return 'undefined' (got '%')") \
254 T(ProxyGetOwnPropertyDescriptorIncompatible, \
255 "'getOwnPropertyDescriptor' on proxy: trap returned descriptor for " \
256 "property '%' that is incompatible with the existing property in the " \
258 T(ProxyGetOwnPropertyDescriptorInvalid, \
259 "'getOwnPropertyDescriptor' on proxy: trap returned neither object nor " \
260 "undefined for property '%'") \
261 T(ProxyGetOwnPropertyDescriptorNonConfigurable, \
262 "'getOwnPropertyDescriptor' on proxy: trap reported non-configurability " \
263 "for property '%' which is either non-existent or configurable in the " \
265 T(ProxyGetOwnPropertyDescriptorNonConfigurableWritable, \
266 "'getOwnPropertyDescriptor' on proxy: trap reported non-configurable " \
267 "and non-writable for property '%' which is non-configurable, writable " \
268 "in the proxy target") \
269 T(ProxyGetOwnPropertyDescriptorNonExtensible, \
270 "'getOwnPropertyDescriptor' on proxy: trap returned undefined for " \
271 "property '%' which exists in the non-extensible proxy target") \
272 T(ProxyGetOwnPropertyDescriptorUndefined, \
273 "'getOwnPropertyDescriptor' on proxy: trap returned undefined for " \
274 "property '%' which is non-configurable in the proxy target") \
275 T(ProxyGetPrototypeOfInvalid, \
276 "'getPrototypeOf' on proxy: trap returned neither object nor null") \
277 T(ProxyGetPrototypeOfNonExtensible, \
278 "'getPrototypeOf' on proxy: proxy target is non-extensible but the " \
279 "trap did not return its actual prototype") \
280 T(ProxyHasNonConfigurable, \
281 "'has' on proxy: trap returned falsish for property '%' which exists in " \
282 "the proxy target as non-configurable") \
283 T(ProxyHasNonExtensible, \
284 "'has' on proxy: trap returned falsish for property '%' but the proxy " \
285 "target is not extensible") \
286 T(ProxyIsExtensibleInconsistent, \
287 "'isExtensible' on proxy: trap result does not reflect extensibility of " \
288 "proxy target (which is '%')") \
290 "Cannot create proxy with a non-object as target or handler") \
291 T(ProxyOwnKeysMissing, \
292 "'ownKeys' on proxy: trap result did not include '%'") \
293 T(ProxyOwnKeysNonExtensible, \
294 "'ownKeys' on proxy: trap returned extra keys but proxy target is " \
296 T(ProxyOwnKeysDuplicateEntries, \
297 "'ownKeys' on proxy: trap returned duplicate entries") \
298 T(ProxyPreventExtensionsExtensible, \
299 "'preventExtensions' on proxy: trap returned truish but the proxy target " \
301 T(ProxyPrivate, "Cannot pass private property name to proxy trap") \
302 T(ProxyRevoked, "Cannot perform '%' on a proxy that has been revoked") \
303 T(ProxySetFrozenData, \
304 "'set' on proxy: trap returned truish for property '%' which exists in " \
305 "the proxy target as a non-configurable and non-writable data property " \
306 "with a different value") \
307 T(ProxySetFrozenAccessor, \
308 "'set' on proxy: trap returned truish for property '%' which exists in " \
309 "the proxy target as a non-configurable and non-writable accessor " \
310 "property without a setter") \
311 T(ProxySetPrototypeOfNonExtensible, \
312 "'setPrototypeOf' on proxy: trap returned truish for setting a new " \
313 "prototype on the non-extensible proxy target") \
314 T(ProxyTrapReturnedFalsish, "'%' on proxy: trap returned falsish") \
315 T(ProxyTrapReturnedFalsishFor, \
316 "'%' on proxy: trap returned falsish for property '%'") \
317 T(RedefineDisallowed, "Cannot redefine property: %") \
318 T(RedefineExternalArray, \
319 "Cannot redefine a property of an object with external array elements") \
320 T(ReduceNoInitial, "Reduce of empty array with no initial value") \
322 "Cannot supply flags when constructing one RegExp from another") \
323 T(RegExpNonObject, "% getter called on non-object %") \
324 T(RegExpNonRegExp, "% getter called on non-RegExp object") \
325 T(RegExpGlobalInvokedOnNonGlobal, \
326 "% called with a non-global RegExp argument") \
327 T(RelativeDateTimeFormatterBadParameters, \
328 "Incorrect RelativeDateTimeFormatter provided") \
329 T(ResolverNotAFunction, "Promise resolver % is not a function") \
330 T(ReturnMethodNotCallable, "The iterator's 'return' method is not callable") \
331 T(SizeIsNaN, "The .size property is NaN") \
332 T(ShadowRealmErrorStackNonString, \
333 "Error stack is not a string in ShadowRealm (%)") \
334 T(ShadowRealmErrorStackThrows, \
335 "Error stack getter threw in ShadowRealm (%)") \
336 T(SharedArrayBufferTooShort, \
337 "Derived SharedArrayBuffer constructor created a buffer which was too " \
339 T(SharedArrayBufferSpeciesThis, \
340 "SharedArrayBuffer subclass returned this from species constructor") \
341 T(SharedStructTypeRegistryMismatch, \
342 "SharedStructType registered as '%' does not match") \
344 "Classes may not have a static property named 'prototype'") \
345 T(StrictDeleteProperty, "Cannot delete property '%' of %") \
346 T(StrictPoisonPill, \
347 "'caller', 'callee', and 'arguments' properties may not be accessed on " \
348 "strict mode functions or the arguments objects for calls to them") \
349 T(StrictReadOnlyProperty, \
350 "Cannot assign to read only property '%' of % '%'") \
351 T(StrictCannotCreateProperty, "Cannot create property '%' on % '%'") \
352 T(StringMatchAllNullOrUndefinedFlags, \
353 "The .flags property of the argument to String.prototype.matchAll cannot " \
354 "be null or undefined") \
355 T(SymbolIteratorInvalid, \
356 "Result of the Symbol.iterator method is not an object") \
357 T(SymbolAsyncIteratorInvalid, \
358 "Result of the Symbol.asyncIterator method is not an object") \
359 T(SymbolKeyFor, "% is not a symbol") \
360 T(SymbolToNumber, "Cannot convert a Symbol value to a number") \
361 T(SymbolToString, "Cannot convert a Symbol value to a string") \
362 T(ThrowMethodMissing, "The iterator does not provide a 'throw' method.") \
363 T(TopLevelAwaitStalled, "Top-level await promise never resolved") \
364 T(UndefinedOrNullToObject, "Cannot convert undefined or null to object") \
365 T(UsingAssign, "Assignment to using variable.") \
366 T(ValueAndAccessor, \
367 "Invalid property descriptor. Cannot both specify accessors and a value " \
368 "or writable attribute, %") \
369 T(VarRedeclaration, "Identifier '%' has already been declared") \
370 T(VarNotAllowedInEvalScope, \
371 "Identifier '%' cannot be declared with 'var' in current evaluation " \
372 "scope, consider trying 'let' instead") \
373 T(WrongArgs, "%: Arguments list has wrong type") \
375 T(NotDefined, "% is not defined") \
376 T(SuperAlreadyCalled, "Super constructor may only be called once") \
377 T(AccessedUninitializedVariable, "Cannot access '%' before initialization") \
378 T(UnsupportedSuper, "Unsupported reference to 'super'") \
379 T(AccessedUnavailableVariable, "Cannot access '%' from debugger") \
380 T(DisposableStackIsDisposed, \
381 "Cannot call % on an already-disposed DisposableStack") \
382 T(NotAnAsyncDisposableStack, "Receiver is not an AsyncDisposableStack") \
384 T(BigIntDivZero, "Division by zero") \
385 T(BigIntTooBig, "Maximum BigInt size exceeded") \
386 T(CantSetOptionXWhenYIsUsed, "Can't set option % when % is used") \
387 T(DateRange, "Provided date is not in valid range.") \
388 T(ExpectedLocation, \
389 "Expected letters optionally connected with underscores or hyphens for " \
390 "a location, got %") \
391 T(InvalidArrayBufferLength, "Invalid array buffer length") \
392 T(InvalidArrayBufferMaxLength, "Invalid array buffer max length") \
393 T(InvalidArrayBufferResizeLength, "%: Invalid length parameter") \
394 T(ArrayBufferAllocationFailed, "Array buffer allocation failed") \
395 T(Invalid, "Invalid % : %") \
396 T(InvalidArrayLength, "Invalid array length") \
397 T(InvalidAtomicAccessIndex, "Invalid atomic access index") \
398 T(InvalidCalendar, "Invalid calendar specified: %") \
399 T(InvalidCodePoint, "Invalid code point %") \
400 T(InvalidCountValue, "Invalid count value: %") \
401 T(InvalidDataViewAccessorOffset, \
402 "Offset is outside the bounds of the DataView") \
403 T(InvalidDataViewLength, "Invalid DataView length %") \
404 T(InvalidOffset, "Start offset % is outside the bounds of the buffer") \
405 T(InvalidHint, "Invalid hint: %") \
406 T(InvalidIndex, "Invalid value: not (convertible to) a safe integer") \
407 T(InvalidLanguageTag, "Invalid language tag: %") \
408 T(InvalidWeakMapKey, "Invalid value used as weak map key") \
409 T(InvalidWeakSetValue, "Invalid value used in weak set") \
410 T(InvalidShadowRealmEvaluateSourceText, "Invalid value used as source text") \
411 T(InvalidStringLength, "Invalid string length") \
412 T(InvalidTimeValue, "Invalid time value") \
413 T(InvalidTimeValueForTemporal, "Invalid time value for Temporal %") \
414 T(InvalidTimeZone, "Invalid time zone specified: %") \
415 T(InvalidTypedArrayAlignment, "% of % should be a multiple of %") \
416 T(InvalidTypedArrayIndex, "Invalid typed array index") \
417 T(InvalidTypedArrayLength, "Invalid typed array length: %") \
418 T(LetInLexicalBinding, "let is disallowed as a lexically bound name") \
419 T(LocaleMatcher, "Illegal value for localeMatcher:%") \
420 T(MaximumFractionDigitsNotEqualMinimumFractionDigits, \
421 "maximumFractionDigits not equal to minimumFractionDigits") \
422 T(NormalizationForm, "The normalization form should be one of %.") \
423 T(OutOfMemory, "%: Out of memory") \
424 T(ZeroDigitNumericSeparator, \
425 "Numeric separator can not be used after leading 0.") \
426 T(NumberFormatRange, "% argument must be between 0 and 100") \
427 T(TrailingNumericSeparator, \
428 "Numeric separators are not allowed at the end of numeric literals") \
429 T(ContinuousNumericSeparator, \
430 "Only one underscore is allowed as numeric separator") \
431 T(PropertyValueOutOfRange, "% value is out of range.") \
432 T(StackOverflow, "Maximum call stack size exceeded") \
433 T(ToPrecisionFormatRange, \
434 "toPrecision() argument must be between 1 and 100") \
435 T(ToRadixFormatRange, "toString() radix argument must be between 2 and 36") \
436 T(SharedArraySizeOutOfRange, "SharedArray length out of range") \
437 T(StructFieldCountOutOfRange, \
438 "Struct field count out of range (maximum of 999 allowed)") \
439 T(TypedArraySetOffsetOutOfBounds, "offset is out of bounds") \
440 T(TypedArraySetSourceTooLarge, "Source is too large") \
441 T(TypedArrayTooLargeToSort, \
442 "Custom comparefn not supported for huge TypedArrays") \
443 T(ValueOutOfRange, "Value % out of range for % options property %") \
444 T(CollectionGrowFailed, "% maximum size exceeded") \
445 T(MustBePositive, "% must be positive") \
446 T(ArgumentIsNotUndefinedOrInteger, \
447 "% argument must be undefined or an integer") \
450 "The requested module '%' contains conflicting star exports for name '%'") \
451 T(BadGetterArity, "Getter must not have any formal parameters.") \
452 T(BadSetterArity, "Setter must have exactly one formal parameter.") \
454 "The base64 input terminates with non-zero padding bits.") \
455 T(Base64InputRemainder, \
456 "The base64 input terminates with a single " \
457 "character, excluding padding (=).") \
458 T(BigIntInvalidString, "Invalid BigInt string") \
459 T(ConstructorIsAccessor, "Class constructor may not be an accessor") \
460 T(ConstructorIsGenerator, "Class constructor may not be a generator") \
461 T(ConstructorIsAsync, "Class constructor may not be an async method") \
462 T(ConstructorIsPrivate, "Class constructor may not be a private method") \
463 T(DerivedConstructorReturnedNonObject, \
464 "Derived constructors may only return object or undefined") \
465 T(DuplicateConstructor, "A class may only have one constructor") \
466 T(DuplicateExport, "Duplicate export of '%'") \
468 "Duplicate __proto__ fields are not allowed in object literals") \
469 T(ForInOfLoopInitializer, \
470 "% loop variable declaration may not have an initializer.") \
471 T(ForOfLet, "The left-hand side of a for-of loop may not start with 'let'.") \
472 T(ForOfAsync, "The left-hand side of a for-of loop may not be 'async'.") \
473 T(ForInOfLoopMultiBindings, \
474 "Invalid left-hand side in % loop: Must have a single binding.") \
475 T(GeneratorInSingleStatementContext, \
476 "Generators can only be declared at the top level or inside a block.") \
477 T(AsyncFunctionInSingleStatementContext, \
478 "Async functions can only be declared at the top level or inside a " \
480 T(IllegalBreak, "Illegal break statement") \
481 T(ModuleExportNameWithoutFromClause, \
482 "String literal module export names must be followed by a 'from' clause") \
483 T(NoIterationStatement, \
484 "Illegal continue statement: no surrounding iteration statement") \
486 "Illegal continue statement: '%' does not denote an iteration statement") \
487 T(IllegalLanguageModeDirective, \
488 "Illegal '%' directive in function with non-simple parameter list") \
489 T(IllegalReturn, "Illegal return statement") \
490 T(IntrinsicWithSpread, "Intrinsic calls do not support spread arguments") \
491 T(InvalidBase64Character, \
492 "Found a character that cannot be part of a valid base64 string.") \
493 T(InvalidRestBindingPattern, \
494 "`...` must be followed by an identifier in declaration contexts") \
495 T(InvalidPropertyBindingPattern, "Illegal property in declaration context") \
496 T(InvalidRestAssignmentPattern, \
497 "`...` must be followed by an assignable reference in assignment " \
499 T(InvalidEscapedReservedWord, "Keyword must not contain escaped characters") \
500 T(InvalidEscapedMetaProperty, "'%' must not contain escaped characters") \
501 T(InvalidLhsInAssignment, "Invalid left-hand side in assignment") \
502 T(InvalidCoverInitializedName, "Invalid shorthand property initializer") \
503 T(InvalidDestructuringTarget, "Invalid destructuring assignment target") \
504 T(InvalidLhsInFor, "Invalid left-hand side in for-loop") \
505 T(InvalidLhsInPostfixOp, \
506 "Invalid left-hand side expression in postfix operation") \
507 T(InvalidLhsInPrefixOp, \
508 "Invalid left-hand side expression in prefix operation") \
509 T(InvalidHexString, \
510 "Input string must contain hex characters in even length") \
511 T(InvalidModuleExportName, \
512 "Invalid module export name: contains unpaired surrogate") \
513 T(InvalidRegExpFlags, "Invalid flags supplied to RegExp constructor '%'") \
514 T(InvalidOrUnexpectedToken, "Invalid or unexpected token") \
515 T(InvalidPrivateBrandInstance, "Receiver must be an instance of class %") \
516 T(InvalidPrivateBrandStatic, "Receiver must be class %") \
517 T(InvalidPrivateBrandReinitialization, \
518 "Cannot initialize private methods of class % twice on the same object") \
519 T(InvalidPrivateFieldReinitialization, \
520 "Cannot initialize % twice on the same object") \
521 T(InvalidPrivateFieldResolution, \
522 "Private field '%' must be declared in an enclosing class") \
523 T(InvalidPrivateMemberRead, \
524 "Cannot read private member % from an object whose class did not declare " \
526 T(InvalidPrivateMemberWrite, \
527 "Cannot write private member % to an object whose class did not declare " \
529 T(InvalidPrivateMethodWrite, "Private method '%' is not writable") \
530 T(InvalidPrivateGetterAccess, "'%' was defined without a getter") \
531 T(InvalidPrivateSetterAccess, "'%' was defined without a setter") \
532 T(InvalidSizeValue, "'%' is an invalid size") \
533 T(InvalidUnusedPrivateStaticMethodAccessedByDebugger, \
534 "Unused static private method '%' cannot be accessed at debug time") \
535 T(InvalidUsingInForInLoop, "Invalid 'using' in for-in loop") \
536 T(JsonParseUnexpectedEOS, "Unexpected end of JSON input") \
537 T(JsonParseUnexpectedTokenNumber, \
538 "Unexpected number in JSON at position % (line % column %)") \
539 T(JsonParseUnexpectedTokenString, \
540 "Unexpected string in JSON at position % (line % column %)") \
541 T(JsonParseUnterminatedString, \
542 "Unterminated string in JSON at position % (line % column %)") \
543 T(JsonParseExpectedPropNameOrRBrace, \
544 "Expected property name or '}' in JSON at position % (line % column %)") \
545 T(JsonParseExpectedCommaOrRBrack, \
546 "Expected ',' or ']' after array element in JSON at position % (line % " \
548 T(JsonParseExpectedCommaOrRBrace, \
549 "Expected ',' or '}' after property value in JSON at position " \
550 "% (line % column %)") \
551 T(JsonParseExpectedDoubleQuotedPropertyName, \
552 "Expected double-quoted property name in JSON at position % (line % " \
554 T(JsonParseExponentPartMissingNumber, \
555 "Exponent part is missing a number in JSON at position % (line % column " \
557 T(JsonParseExpectedColonAfterPropertyName, \
558 "Expected ':' after property name in JSON at position % (line % column " \
560 T(JsonParseUnterminatedFractionalNumber, \
561 "Unterminated fractional number in JSON at position % (line % column %)") \
562 T(JsonParseUnexpectedNonWhiteSpaceCharacter, \
563 "Unexpected non-whitespace character after JSON at position " \
564 "% (line % column %)") \
565 T(JsonParseBadEscapedCharacter, \
566 "Bad escaped character in JSON at position % (line % column %)") \
567 T(JsonParseBadControlCharacter, \
568 "Bad control character in string literal in JSON at position % (line % " \
570 T(JsonParseBadUnicodeEscape, \
571 "Bad Unicode escape in JSON at position % (line % column %)") \
572 T(JsonParseNoNumberAfterMinusSign, \
573 "No number after minus sign in JSON at position % (line % column %)") \
574 T(JsonParseShortString, "\"%\" is not valid JSON") \
575 T(JsonParseUnexpectedTokenShortString, \
576 "Unexpected token '%', \"%\" is not valid JSON") \
577 T(JsonParseUnexpectedTokenSurroundStringWithContext, \
578 "Unexpected token '%', ...\"%\"... is not valid JSON") \
579 T(JsonParseUnexpectedTokenEndStringWithContext, \
580 "Unexpected token '%', ...\"%\" is not valid JSON") \
581 T(JsonParseUnexpectedTokenStartStringWithContext, \
582 "Unexpected token '%', \"%\"... is not valid JSON") \
583 T(LabelRedeclaration, "Label '%' has already been declared") \
584 T(LabelledFunctionDeclaration, \
585 "Labelled function declaration not allowed as the body of a control flow " \
587 T(MalformedArrowFunParamList, "Malformed arrow function parameter list") \
588 T(MalformedRegExp, "Invalid regular expression: /%/%: %") \
589 T(MalformedRegExpFlags, "Invalid regular expression flags") \
590 T(ModuleExportUndefined, "Export '%' is not defined in module") \
591 T(MissingFunctionName, "Function statements require a function name") \
592 T(HtmlCommentInModule, "HTML comments are not allowed in modules") \
593 T(MultipleDefaultsInSwitch, \
594 "More than one default clause in switch statement") \
595 T(NewlineAfterThrow, "Illegal newline after throw") \
596 T(NoCatchOrFinally, "Missing catch or finally after try") \
597 T(ParamAfterRest, "Rest parameter must be last formal parameter") \
598 T(FlattenPastSafeLength, \
599 "Flattening % elements on an array-like of length % " \
600 "is disallowed, as the total surpasses 2**53-1") \
601 T(PushPastSafeLength, \
602 "Pushing % elements on an array-like of length % " \
603 "is disallowed, as the total surpasses 2**53-1") \
604 T(ElementAfterRest, "Rest element must be last element") \
605 T(BadSetterRestParameter, \
606 "Setter function argument must not be a rest parameter") \
607 T(ParamDupe, "Duplicate parameter name not allowed in this context") \
608 T(ArgStringTerminatesParametersEarly, \
609 "Arg string terminates parameters early") \
610 T(UnexpectedEndOfArgString, "Unexpected end of arg string") \
611 T(RestDefaultInitializer, \
612 "Rest parameter may not have a default initializer") \
613 T(RuntimeWrongNumArgs, "Runtime function given wrong number of arguments") \
615 "Must call super constructor in derived class before accessing 'this' or " \
616 "returning from derived constructor") \
617 T(SingleFunctionLiteral, "Single function literal required") \
619 "In non-strict mode code, functions can only be declared at top level, " \
620 "inside a block, or as the body of an if statement.") \
621 T(SpeciesNotConstructor, \
622 "object.constructor[Symbol.species] is not a constructor") \
623 T(StrictDelete, "Delete of an unqualified identifier in strict mode.") \
624 T(StrictEvalArguments, "Unexpected eval or arguments in strict mode") \
626 "In strict mode code, functions can only be declared at top level or " \
628 T(StrictOctalLiteral, "Octal literals are not allowed in strict mode.") \
629 T(StrictDecimalWithLeadingZero, \
630 "Decimals with leading zeros are not allowed in strict mode.") \
631 T(StrictOctalEscape, \
632 "Octal escape sequences are not allowed in strict mode.") \
633 T(Strict8Or9Escape, "\\8 and \\9 are not allowed in strict mode.") \
634 T(StrictWith, "Strict mode code may not include a with statement") \
635 T(TemplateOctalLiteral, \
636 "Octal escape sequences are not allowed in template strings.") \
637 T(Template8Or9Escape, "\\8 and \\9 are not allowed in template strings.") \
638 T(ThisFormalParameter, "'this' is not a valid formal parameter name") \
639 T(AwaitBindingIdentifier, \
640 "'await' is not a valid identifier name in an async function") \
641 T(AwaitExpressionFormalParameter, \
642 "Illegal await-expression in formal parameters of async function") \
643 T(TooManyArguments, \
644 "Too many arguments in function call (only 65535 allowed)") \
645 T(TooManyParameters, \
646 "Too many parameters in function definition (only 65534 allowed)") \
647 T(TooManyProperties, "Too many properties to enumerate") \
649 "Literal containing too many nested spreads (up to 65534 allowed)") \
650 T(TooManyVariables, "Too many variables declared (only 4194303 allowed)") \
651 T(TooManyElementsInPromiseCombinator, \
652 "Too many elements passed to Promise.%") \
653 T(TypedArrayTooShort, \
654 "Derived TypedArray constructor created an array which was too small") \
655 T(UnexpectedEOS, "Unexpected end of input") \
656 T(UnexpectedPrivateField, "Unexpected private field") \
657 T(UnexpectedReserved, "Unexpected reserved word") \
658 T(UnexpectedStrictReserved, "Unexpected strict mode reserved word") \
659 T(UnexpectedSuper, "'super' keyword unexpected here") \
660 T(UnexpectedNewTarget, "new.target expression is not allowed here") \
661 T(UnexpectedTemplateString, "Unexpected template string") \
662 T(UnexpectedToken, "Unexpected token '%'") \
663 T(UnexpectedTokenUnaryExponentiation, \
664 "Unary operator used immediately before exponentiation expression. " \
665 "Parenthesis must be used to disambiguate operator precedence") \
666 T(UnexpectedTokenIdentifier, "Unexpected identifier '%'") \
667 T(UnexpectedTokenNumber, "Unexpected number") \
668 T(UnexpectedTokenString, "Unexpected string") \
669 T(UnexpectedTokenRegExp, "Unexpected regular expression") \
670 T(UnexpectedLexicalDeclaration, \
671 "Lexical declaration cannot appear in a single-statement context") \
672 T(UnknownLabel, "Undefined label '%'") \
673 T(UnresolvableExport, \
674 "The requested module '%' does not provide an export named '%'") \
675 T(UnterminatedArgList, "missing ) after argument list") \
676 T(UnterminatedRegExp, "Invalid regular expression: missing /") \
677 T(UnterminatedTemplate, "Unterminated template literal") \
678 T(UnterminatedTemplateExpr, "Missing } in template expression") \
679 T(FoundNonCallableHasInstance, "Found non-callable @@hasInstance") \
680 T(InvalidHexEscapeSequence, "Invalid hexadecimal escape sequence") \
681 T(InvalidUnicodeEscapeSequence, "Invalid Unicode escape sequence") \
682 T(UndefinedUnicodeCodePoint, "Undefined Unicode code-point") \
683 T(YieldInParameter, "Yield expression not allowed in formal parameter") \
685 T(CodeGenFromStrings, "%") \
686 T(NoSideEffectDebugEvaluate, "Possible side-effect in debug-evaluate") \
688 T(URIMalformed, "URI malformed") \
690 T(WasmTrapUnreachable, "unreachable") \
691 T(WasmTrapMemOutOfBounds, "memory access out of bounds") \
692 T(WasmTrapUnalignedAccess, "operation does not support unaligned accesses") \
693 T(WasmTrapDivByZero, "divide by zero") \
694 T(WasmTrapDivUnrepresentable, "divide result unrepresentable") \
695 T(WasmTrapRemByZero, "remainder by zero") \
696 T(WasmTrapFloatUnrepresentable, "float unrepresentable in integer range") \
697 T(WasmTrapTableOutOfBounds, "table index is out of bounds") \
698 T(WasmTrapFuncSigMismatch, "null function or function signature mismatch") \
699 T(WasmTrapMultiReturnLengthMismatch, "multi-return length mismatch") \
700 T(WasmTrapJSTypeError, "type incompatibility when transforming from/to JS") \
701 T(WasmTrapDataSegmentOutOfBounds, "data segment out of bounds") \
702 T(WasmTrapElementSegmentOutOfBounds, "element segment out of bounds") \
703 T(WasmTrapRethrowNull, "rethrowing null value") \
704 T(WasmTrapNullDereference, "dereferencing a null pointer") \
705 T(WasmTrapIllegalCast, "illegal cast") \
706 T(WasmTrapArrayOutOfBounds, "array element access out of bounds") \
707 T(WasmTrapArrayTooLarge, "requested new array is too large") \
708 T(WasmTrapStringInvalidUtf8, "invalid UTF-8 string") \
709 T(WasmTrapStringInvalidWtf8, "invalid WTF-8 string") \
710 T(WasmTrapStringOffsetOutOfBounds, "string offset out of bounds") \
711 T(WasmSuspendError, "trying to suspend without WebAssembly.promising") \
712 T(WasmTrapStringIsolatedSurrogate, \
713 "Failed to encode string as UTF-8: contains unpaired surrogate") \
714 T(WasmSuspendJSFrames, "trying to suspend JS frames") \
715 T(WasmExceptionError, "wasm exception") \
716 T(WasmObjectsAreOpaque, "WebAssembly objects are opaque") \
718 T(AsmJsInvalid, "Invalid asm.js: %") \
719 T(AsmJsCompiled, "Converted asm.js to WebAssembly: %") \
720 T(AsmJsInstantiated, "Instantiated asm.js: %") \
721 T(AsmJsLinkingFailed, "Linking failure in asm.js: %") \
723 T(DataCloneError, "% could not be cloned.") \
724 T(DataCloneErrorOutOfMemory, "Data cannot be cloned, out of memory.") \
725 T(DataCloneErrorDetachedArrayBuffer, \
726 "An ArrayBuffer is detached and could not be cloned.") \
727 T(DataCloneErrorNonDetachableArrayBuffer, \
728 "ArrayBuffer is not detachable and could not be cloned.") \
729 T(DataCloneErrorSharedArrayBufferTransferred, \
730 "A SharedArrayBuffer could not be cloned. SharedArrayBuffer must not be " \
732 T(DataCloneDeserializationError, "Unable to deserialize cloned data.") \
733 T(DataCloneDeserializationVersionError, \
734 "Unable to deserialize cloned data due to invalid or unsupported " \
737 T(TraceEventCategoryError, "Trace event category must be a string.") \
738 T(TraceEventNameError, "Trace event name must be a string.") \
739 T(TraceEventNameLengthError, \
740 "Trace event name must not be an empty string.") \
741 T(TraceEventPhaseError, "Trace event phase must be a number.") \
742 T(TraceEventIDError, "Trace event id must be a number.") \
744 T(InvalidWeakRefsUnregisterToken, "Invalid unregisterToken ('%')") \
745 T(WeakRefsCleanupMustBeCallable, \
746 "FinalizationRegistry: cleanup must be callable") \
747 T(InvalidWeakRefsRegisterTarget, \
748 "FinalizationRegistry.prototype.register: invalid target") \
749 T(WeakRefsRegisterTargetAndHoldingsMustNotBeSame, \
750 "FinalizationRegistry.prototype.register: target and holdings must not " \
752 T(InvalidWeakRefsWeakRefConstructorTarget, "WeakRef: invalid target") \
753 T(OptionalChainingNoNew, "Invalid optional chain from new expression") \
754 T(OptionalChainingNoSuper, "Invalid optional chain from super property") \
755 T(OptionalChainingNoTemplate, "Invalid tagged template on optional chain") \
757 T(AllPromisesRejected, "All promises were rejected") \
758 T(CannotDeepFreezeObject, "Cannot DeepFreeze object of type %") \
759 T(CannotDeepFreezeValue, "Cannot DeepFreeze non-const value %") \
761 T(SuppressedErrorDuringDisposal, "An error was suppressed during disposal") \
762 T(ExpectAnObjectWithUsing, \
763 "An object is expected with `using` " \
767#define TEMPLATE(NAME, STRING) k##NAME,
774 DCHECK_LT(
static_cast<unsigned>(message_id),
#define MESSAGE_TEMPLATES(T)
MessageTemplate MessageTemplateFromInt(int message_id)
#define DCHECK_LT(v1, v2)