| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 bool IsValid() { return !fun_.is_null(); } | 65 bool IsValid() { return !fun_.is_null(); } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 Isolate* isolate_; | 68 Isolate* isolate_; |
| 69 Handle<Object> receiver_; | 69 Handle<Object> receiver_; |
| 70 Handle<JSFunction> fun_; | 70 Handle<JSFunction> fun_; |
| 71 int32_t pos_; | 71 int32_t pos_; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 | |
| 75 #define MESSAGE_TEMPLATES(T) \ | 74 #define MESSAGE_TEMPLATES(T) \ |
| 76 /* Error */ \ | 75 /* Error */ \ |
| 77 T(None, "") \ | 76 T(None, "") \ |
| 78 T(CyclicProto, "Cyclic __proto__ value") \ | 77 T(CyclicProto, "Cyclic __proto__ value") \ |
| 79 T(Debugger, "Debugger: %") \ | 78 T(Debugger, "Debugger: %") \ |
| 80 T(DebuggerLoading, "Error loading debugger") \ | 79 T(DebuggerLoading, "Error loading debugger") \ |
| 81 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \ | 80 T(DefaultOptionsMissing, "Internal % error. Default options are missing.") \ |
| 82 T(UncaughtException, "Uncaught %") \ | 81 T(UncaughtException, "Uncaught %") \ |
| 83 T(Unsupported, "Not supported") \ | 82 T(Unsupported, "Not supported") \ |
| 84 T(WrongServiceType, "Internal error, wrong service type: %") \ | 83 T(WrongServiceType, "Internal error, wrong service type: %") \ |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 T(BadGetterArity, "Getter must not have any formal parameters.") \ | 376 T(BadGetterArity, "Getter must not have any formal parameters.") \ |
| 378 T(BadSetterArity, "Setter must have exactly one formal parameter.") \ | 377 T(BadSetterArity, "Setter must have exactly one formal parameter.") \ |
| 379 T(ConstructorIsAccessor, "Class constructor may not be an accessor") \ | 378 T(ConstructorIsAccessor, "Class constructor may not be an accessor") \ |
| 380 T(ConstructorIsGenerator, "Class constructor may not be a generator") \ | 379 T(ConstructorIsGenerator, "Class constructor may not be a generator") \ |
| 381 T(DerivedConstructorReturn, \ | 380 T(DerivedConstructorReturn, \ |
| 382 "Derived constructors may only return object or undefined") \ | 381 "Derived constructors may only return object or undefined") \ |
| 383 T(DuplicateConstructor, "A class may only have one constructor") \ | 382 T(DuplicateConstructor, "A class may only have one constructor") \ |
| 384 T(DuplicateExport, "Duplicate export of '%'") \ | 383 T(DuplicateExport, "Duplicate export of '%'") \ |
| 385 T(DuplicateProto, \ | 384 T(DuplicateProto, \ |
| 386 "Duplicate __proto__ fields are not allowed in object literals") \ | 385 "Duplicate __proto__ fields are not allowed in object literals") \ |
| 387 T(ForInLoopInitializer, \ | 386 T(ForInOfLoopInitializer, \ |
| 388 "for-in loop variable declaration may not have an initializer.") \ | 387 "% loop variable declaration may not have an initializer.") \ |
| 389 T(ForInOfLoopMultiBindings, \ | 388 T(ForInOfLoopMultiBindings, \ |
| 390 "Invalid left-hand side in % loop: Must have a single binding.") \ | 389 "Invalid left-hand side in % loop: Must have a single binding.") \ |
| 391 T(ForOfLoopInitializer, \ | |
| 392 "for-of loop variable declaration may not have an initializer.") \ | |
| 393 T(IllegalAccess, "Illegal access") \ | 390 T(IllegalAccess, "Illegal access") \ |
| 394 T(IllegalBreak, "Illegal break statement") \ | 391 T(IllegalBreak, "Illegal break statement") \ |
| 395 T(IllegalContinue, "Illegal continue statement") \ | 392 T(IllegalContinue, "Illegal continue statement") \ |
| 396 T(IllegalLanguageModeDirective, \ | 393 T(IllegalLanguageModeDirective, \ |
| 397 "Illegal '%' directive in function with non-simple parameter list") \ | 394 "Illegal '%' directive in function with non-simple parameter list") \ |
| 398 T(IllegalReturn, "Illegal return statement") \ | 395 T(IllegalReturn, "Illegal return statement") \ |
| 399 T(InvalidEscapedReservedWord, "Keyword must not contain escaped characters") \ | 396 T(InvalidEscapedReservedWord, "Keyword must not contain escaped characters") \ |
| 400 T(InvalidLhsInAssignment, "Invalid left-hand side in assignment") \ | 397 T(InvalidLhsInAssignment, "Invalid left-hand side in assignment") \ |
| 401 T(InvalidCoverInitializedName, "Invalid shorthand property initializer") \ | 398 T(InvalidCoverInitializedName, "Invalid shorthand property initializer") \ |
| 402 T(InvalidDestructuringTarget, "Invalid destructuring assignment target") \ | 399 T(InvalidDestructuringTarget, "Invalid destructuring assignment target") \ |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 556 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
| 560 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 557 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
| 561 Handle<Object> data); | 558 Handle<Object> data); |
| 562 }; | 559 }; |
| 563 | 560 |
| 564 | 561 |
| 565 } // namespace internal | 562 } // namespace internal |
| 566 } // namespace v8 | 563 } // namespace v8 |
| 567 | 564 |
| 568 #endif // V8_MESSAGES_H_ | 565 #endif // V8_MESSAGES_H_ |
| OLD | NEW |