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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 T(MalformedArrowFunParamList, "Malformed arrow function parameter list") \ | 409 T(MalformedArrowFunParamList, "Malformed arrow function parameter list") \ |
411 T(MalformedRegExp, "Invalid regular expression: /%/: %") \ | 410 T(MalformedRegExp, "Invalid regular expression: /%/: %") \ |
412 T(MalformedRegExpFlags, "Invalid regular expression flags") \ | 411 T(MalformedRegExpFlags, "Invalid regular expression flags") \ |
413 T(ModuleExportUndefined, "Export '%' is not defined in module") \ | 412 T(ModuleExportUndefined, "Export '%' is not defined in module") \ |
414 T(MultipleDefaultsInSwitch, \ | 413 T(MultipleDefaultsInSwitch, \ |
415 "More than one default clause in switch statement") \ | 414 "More than one default clause in switch statement") \ |
416 T(NewlineAfterThrow, "Illegal newline after throw") \ | 415 T(NewlineAfterThrow, "Illegal newline after throw") \ |
417 T(NoCatchOrFinally, "Missing catch or finally after try") \ | 416 T(NoCatchOrFinally, "Missing catch or finally after try") \ |
418 T(NotIsvar, "builtin %%IS_VAR: not a variable") \ | 417 T(NotIsvar, "builtin %%IS_VAR: not a variable") \ |
419 T(ParamAfterRest, "Rest parameter must be last formal parameter") \ | 418 T(ParamAfterRest, "Rest parameter must be last formal parameter") \ |
| 419 T(InvalidRestParameter, \ |
| 420 "Rest parameter must be an identifier or destructuring pattern") \ |
420 T(PushPastSafeLength, \ | 421 T(PushPastSafeLength, \ |
421 "Pushing % elements on an array-like of length % " \ | 422 "Pushing % elements on an array-like of length % " \ |
422 "is disallowed, as the total surpasses 2**53-1") \ | 423 "is disallowed, as the total surpasses 2**53-1") \ |
423 T(ElementAfterRest, "Rest element must be last element in array") \ | 424 T(ElementAfterRest, "Rest element must be last element in array") \ |
424 T(BadSetterRestParameter, \ | 425 T(BadSetterRestParameter, \ |
425 "Setter function argument must not be a rest parameter") \ | 426 "Setter function argument must not be a rest parameter") \ |
426 T(ParamDupe, "Duplicate parameter name not allowed in this context") \ | 427 T(ParamDupe, "Duplicate parameter name not allowed in this context") \ |
427 T(ParenthesisInArgString, "Function arg string contains parenthesis") \ | 428 T(ParenthesisInArgString, "Function arg string contains parenthesis") \ |
428 T(SingleFunctionLiteral, "Single function literal required") \ | 429 T(SingleFunctionLiteral, "Single function literal required") \ |
429 T(SloppyLexical, \ | 430 T(SloppyLexical, \ |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 558 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
558 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 559 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
559 Handle<Object> data); | 560 Handle<Object> data); |
560 }; | 561 }; |
561 | 562 |
562 | 563 |
563 } // namespace internal | 564 } // namespace internal |
564 } // namespace v8 | 565 } // namespace v8 |
565 | 566 |
566 #endif // V8_MESSAGES_H_ | 567 #endif // V8_MESSAGES_H_ |
OLD | NEW |