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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 "Function.prototype.apply was called on %, which is a % and not a " \ | 87 "Function.prototype.apply was called on %, which is a % and not a " \ |
88 "function") \ | 88 "function") \ |
89 T(ArrayBufferTooShort, \ | 89 T(ArrayBufferTooShort, \ |
90 "Derived ArrayBuffer constructor created a buffer which was too small") \ | 90 "Derived ArrayBuffer constructor created a buffer which was too small") \ |
91 T(ArrayBufferSpeciesThis, \ | 91 T(ArrayBufferSpeciesThis, \ |
92 "ArrayBuffer subclass returned this from species constructor") \ | 92 "ArrayBuffer subclass returned this from species constructor") \ |
93 T(ArrayFunctionsOnFrozen, "Cannot modify frozen array elements") \ | 93 T(ArrayFunctionsOnFrozen, "Cannot modify frozen array elements") \ |
94 T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \ | 94 T(ArrayFunctionsOnSealed, "Cannot add/remove sealed array elements") \ |
95 T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \ | 95 T(ArrayNotSubclassable, "Subclassing Arrays is not currently supported.") \ |
96 T(CalledNonCallable, "% is not a function") \ | 96 T(CalledNonCallable, "% is not a function") \ |
| 97 T(CalledNonCallableInstanceOf, "right-hand side is not a function") \ |
97 T(CalledOnNonObject, "% called on non-object") \ | 98 T(CalledOnNonObject, "% called on non-object") \ |
98 T(CalledOnNullOrUndefined, "% called on null or undefined") \ | 99 T(CalledOnNullOrUndefined, "% called on null or undefined") \ |
99 T(CallSiteExpectsFunction, \ | 100 T(CallSiteExpectsFunction, \ |
100 "CallSite expects function as second argument, got %") \ | 101 "CallSite expects function as second argument, got %") \ |
101 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \ | 102 T(CannotConvertToPrimitive, "Cannot convert object to primitive value") \ |
102 T(CannotPreventExt, "Cannot prevent extensions") \ | 103 T(CannotPreventExt, "Cannot prevent extensions") \ |
103 T(CannotFreezeArrayBufferView, \ | 104 T(CannotFreezeArrayBufferView, \ |
104 "Cannot freeze array buffer views with elements") \ | 105 "Cannot freeze array buffer views with elements") \ |
105 T(CircularStructure, "Converting circular structure to JSON") \ | 106 T(CircularStructure, "Converting circular structure to JSON") \ |
106 T(ConstructAbstractClass, "Abstract class % not directly constructable") \ | 107 T(ConstructAbstractClass, "Abstract class % not directly constructable") \ |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 T(UnexpectedToken, "Unexpected token %") \ | 512 T(UnexpectedToken, "Unexpected token %") \ |
512 T(UnexpectedTokenIdentifier, "Unexpected identifier") \ | 513 T(UnexpectedTokenIdentifier, "Unexpected identifier") \ |
513 T(UnexpectedTokenNumber, "Unexpected number") \ | 514 T(UnexpectedTokenNumber, "Unexpected number") \ |
514 T(UnexpectedTokenString, "Unexpected string") \ | 515 T(UnexpectedTokenString, "Unexpected string") \ |
515 T(UnexpectedTokenRegExp, "Unexpected regular expression") \ | 516 T(UnexpectedTokenRegExp, "Unexpected regular expression") \ |
516 T(UnknownLabel, "Undefined label '%'") \ | 517 T(UnknownLabel, "Undefined label '%'") \ |
517 T(UnterminatedArgList, "missing ) after argument list") \ | 518 T(UnterminatedArgList, "missing ) after argument list") \ |
518 T(UnterminatedRegExp, "Invalid regular expression: missing /") \ | 519 T(UnterminatedRegExp, "Invalid regular expression: missing /") \ |
519 T(UnterminatedTemplate, "Unterminated template literal") \ | 520 T(UnterminatedTemplate, "Unterminated template literal") \ |
520 T(UnterminatedTemplateExpr, "Missing } in template expression") \ | 521 T(UnterminatedTemplateExpr, "Missing } in template expression") \ |
| 522 T(FoundNonCallableHasInstance, "Found non-callable @@hasInstance") \ |
| 523 T(NonObjectInInstanceOfCheck, "Expecting an object in instanceof check") \ |
521 /* EvalError */ \ | 524 /* EvalError */ \ |
522 T(CodeGenFromStrings, "%") \ | 525 T(CodeGenFromStrings, "%") \ |
523 /* URIError */ \ | 526 /* URIError */ \ |
524 T(URIMalformed, "URI malformed") | 527 T(URIMalformed, "URI malformed") |
525 | 528 |
526 class MessageTemplate { | 529 class MessageTemplate { |
527 public: | 530 public: |
528 enum Template { | 531 enum Template { |
529 #define TEMPLATE(NAME, STRING) k##NAME, | 532 #define TEMPLATE(NAME, STRING) k##NAME, |
530 MESSAGE_TEMPLATES(TEMPLATE) | 533 MESSAGE_TEMPLATES(TEMPLATE) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 566 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
564 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 567 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
565 Handle<Object> data); | 568 Handle<Object> data); |
566 }; | 569 }; |
567 | 570 |
568 | 571 |
569 } // namespace internal | 572 } // namespace internal |
570 } // namespace v8 | 573 } // namespace v8 |
571 | 574 |
572 #endif // V8_MESSAGES_H_ | 575 #endif // V8_MESSAGES_H_ |
OLD | NEW |