| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 T(TypedArraySetSourceTooLarge, "Source is too large") \ | 290 T(TypedArraySetSourceTooLarge, "Source is too large") \ |
| 291 T(UnsupportedTimeZone, "Unsupported time zone specified %") \ | 291 T(UnsupportedTimeZone, "Unsupported time zone specified %") \ |
| 292 T(ValueOutOfRange, "Value % out of range for % options property %") \ | 292 T(ValueOutOfRange, "Value % out of range for % options property %") \ |
| 293 /* SyntaxError */ \ | 293 /* SyntaxError */ \ |
| 294 T(BadGetterArity, "Getter must not have any formal parameters.") \ | 294 T(BadGetterArity, "Getter must not have any formal parameters.") \ |
| 295 T(BadSetterArity, "Setter must have exactly one formal parameter.") \ | 295 T(BadSetterArity, "Setter must have exactly one formal parameter.") \ |
| 296 T(ConstructorIsAccessor, "Class constructor may not be an accessor") \ | 296 T(ConstructorIsAccessor, "Class constructor may not be an accessor") \ |
| 297 T(ConstructorIsGenerator, "Class constructor may not be a generator") \ | 297 T(ConstructorIsGenerator, "Class constructor may not be a generator") \ |
| 298 T(DerivedConstructorReturn, \ | 298 T(DerivedConstructorReturn, \ |
| 299 "Derived constructors may only return object or undefined") \ | 299 "Derived constructors may only return object or undefined") \ |
| 300 T(DuplicateArrawFunFormalParam, \ | |
| 301 "Arrow function may not have duplicate parameter names") \ | |
| 302 T(DuplicateConstructor, "A class may only have one constructor") \ | 300 T(DuplicateConstructor, "A class may only have one constructor") \ |
| 303 T(DuplicateExport, "Duplicate export of '%'") \ | 301 T(DuplicateExport, "Duplicate export of '%'") \ |
| 304 T(DuplicateProto, \ | 302 T(DuplicateProto, \ |
| 305 "Duplicate __proto__ fields are not allowed in object literals") \ | 303 "Duplicate __proto__ fields are not allowed in object literals") \ |
| 306 T(ForInLoopInitializer, \ | 304 T(ForInLoopInitializer, \ |
| 307 "for-in loop variable declaration may not have an initializer.") \ | 305 "for-in loop variable declaration may not have an initializer.") \ |
| 308 T(ForInOfLoopMultiBindings, \ | 306 T(ForInOfLoopMultiBindings, \ |
| 309 "Invalid left-hand side in % loop: Must have a single binding.") \ | 307 "Invalid left-hand side in % loop: Must have a single binding.") \ |
| 310 T(ForOfLoopInitializer, \ | 308 T(ForOfLoopInitializer, \ |
| 311 "for-of loop variable declaration may not have an initializer.") \ | 309 "for-of loop variable declaration may not have an initializer.") \ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 328 "Expected () to start arrow function, but got '%' instead of '=>'") \ | 326 "Expected () to start arrow function, but got '%' instead of '=>'") \ |
| 329 T(ModuleExportUndefined, "Export '%' is not defined in module") \ | 327 T(ModuleExportUndefined, "Export '%' is not defined in module") \ |
| 330 T(MultipleDefaultsInSwitch, \ | 328 T(MultipleDefaultsInSwitch, \ |
| 331 "More than one default clause in switch statement") \ | 329 "More than one default clause in switch statement") \ |
| 332 T(NewlineAfterThrow, "Illegal newline after throw") \ | 330 T(NewlineAfterThrow, "Illegal newline after throw") \ |
| 333 T(NoCatchOrFinally, "Missing catch or finally after try") \ | 331 T(NoCatchOrFinally, "Missing catch or finally after try") \ |
| 334 T(NotIsvar, "builtin %%IS_VAR: not a variable") \ | 332 T(NotIsvar, "builtin %%IS_VAR: not a variable") \ |
| 335 T(ParamAfterRest, "Rest parameter must be last formal parameter") \ | 333 T(ParamAfterRest, "Rest parameter must be last formal parameter") \ |
| 336 T(BadSetterRestParameter, \ | 334 T(BadSetterRestParameter, \ |
| 337 "Setter function argument must not be a rest parameter") \ | 335 "Setter function argument must not be a rest parameter") \ |
| 336 T(ParamDupe, "Duplicate parameter name not allowed in this context") \ |
| 338 T(ParenthesisInArgString, "Function arg string contains parenthesis") \ | 337 T(ParenthesisInArgString, "Function arg string contains parenthesis") \ |
| 339 T(SingleFunctionLiteral, "Single function literal required") \ | 338 T(SingleFunctionLiteral, "Single function literal required") \ |
| 340 T(SloppyLexical, \ | 339 T(SloppyLexical, \ |
| 341 "Block-scoped declarations (let, const, function, class) not yet " \ | 340 "Block-scoped declarations (let, const, function, class) not yet " \ |
| 342 "supported outside strict mode") \ | 341 "supported outside strict mode") \ |
| 343 T(StrictDelete, "Delete of an unqualified identifier in strict mode.") \ | 342 T(StrictDelete, "Delete of an unqualified identifier in strict mode.") \ |
| 344 T(StrictEvalArguments, "Unexpected eval or arguments in strict mode") \ | 343 T(StrictEvalArguments, "Unexpected eval or arguments in strict mode") \ |
| 345 T(StrictFunction, \ | 344 T(StrictFunction, \ |
| 346 "In strict mode code, functions can only be declared at top level or " \ | 345 "In strict mode code, functions can only be declared at top level or " \ |
| 347 "immediately within another function.") \ | 346 "immediately within another function.") \ |
| 348 T(StrictOctalLiteral, "Octal literals are not allowed in strict mode.") \ | 347 T(StrictOctalLiteral, "Octal literals are not allowed in strict mode.") \ |
| 349 T(StrictParamDupe, \ | |
| 350 "Strict mode function may not have duplicate parameter names") \ | |
| 351 T(StrictWith, "Strict mode code may not include a with statement") \ | 348 T(StrictWith, "Strict mode code may not include a with statement") \ |
| 352 T(StrongArguments, \ | 349 T(StrongArguments, \ |
| 353 "In strong mode, 'arguments' is deprecated, use '...args' instead") \ | 350 "In strong mode, 'arguments' is deprecated, use '...args' instead") \ |
| 354 T(StrongConstructorReturnMisplaced, \ | 351 T(StrongConstructorReturnMisplaced, \ |
| 355 "In strong mode, returning from a constructor before its super " \ | 352 "In strong mode, returning from a constructor before its super " \ |
| 356 "constructor invocation or all assignments to 'this' is deprecated") \ | 353 "constructor invocation or all assignments to 'this' is deprecated") \ |
| 357 T(StrongConstructorReturnValue, \ | 354 T(StrongConstructorReturnValue, \ |
| 358 "In strong mode, returning a value from a constructor is deprecated") \ | 355 "In strong mode, returning a value from a constructor is deprecated") \ |
| 359 T(StrongConstructorSuper, \ | 356 T(StrongConstructorSuper, \ |
| 360 "In strong mode, 'super' can only be used to invoke the super " \ | 357 "In strong mode, 'super' can only be used to invoke the super " \ |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 452 |
| 456 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, | 453 static void DefaultMessageReport(Isolate* isolate, const MessageLocation* loc, |
| 457 Handle<Object> message_obj); | 454 Handle<Object> message_obj); |
| 458 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 455 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
| 459 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 456 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
| 460 Handle<Object> data); | 457 Handle<Object> data); |
| 461 }; | 458 }; |
| 462 } } // namespace v8::internal | 459 } } // namespace v8::internal |
| 463 | 460 |
| 464 #endif // V8_MESSAGES_H_ | 461 #endif // V8_MESSAGES_H_ |
| OLD | NEW |