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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 T(UnexpectedToken, "Unexpected token %") \ | 510 T(UnexpectedToken, "Unexpected token %") \ |
510 T(UnexpectedTokenIdentifier, "Unexpected identifier") \ | 511 T(UnexpectedTokenIdentifier, "Unexpected identifier") \ |
511 T(UnexpectedTokenNumber, "Unexpected number") \ | 512 T(UnexpectedTokenNumber, "Unexpected number") \ |
512 T(UnexpectedTokenString, "Unexpected string") \ | 513 T(UnexpectedTokenString, "Unexpected string") \ |
513 T(UnexpectedTokenRegExp, "Unexpected regular expression") \ | 514 T(UnexpectedTokenRegExp, "Unexpected regular expression") \ |
514 T(UnknownLabel, "Undefined label '%'") \ | 515 T(UnknownLabel, "Undefined label '%'") \ |
515 T(UnterminatedArgList, "missing ) after argument list") \ | 516 T(UnterminatedArgList, "missing ) after argument list") \ |
516 T(UnterminatedRegExp, "Invalid regular expression: missing /") \ | 517 T(UnterminatedRegExp, "Invalid regular expression: missing /") \ |
517 T(UnterminatedTemplate, "Unterminated template literal") \ | 518 T(UnterminatedTemplate, "Unterminated template literal") \ |
518 T(UnterminatedTemplateExpr, "Missing } in template expression") \ | 519 T(UnterminatedTemplateExpr, "Missing } in template expression") \ |
| 520 T(FoundNonCallableHasInstance, "Found non-callable @@hasInstance") \ |
| 521 T(NonObjectInInstanceOfCheck, "Expecting an object in instanceof check") \ |
519 /* EvalError */ \ | 522 /* EvalError */ \ |
520 T(CodeGenFromStrings, "%") \ | 523 T(CodeGenFromStrings, "%") \ |
521 /* URIError */ \ | 524 /* URIError */ \ |
522 T(URIMalformed, "URI malformed") | 525 T(URIMalformed, "URI malformed") |
523 | 526 |
524 class MessageTemplate { | 527 class MessageTemplate { |
525 public: | 528 public: |
526 enum Template { | 529 enum Template { |
527 #define TEMPLATE(NAME, STRING) k##NAME, | 530 #define TEMPLATE(NAME, STRING) k##NAME, |
528 MESSAGE_TEMPLATES(TEMPLATE) | 531 MESSAGE_TEMPLATES(TEMPLATE) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); | 564 static Handle<String> GetMessage(Isolate* isolate, Handle<Object> data); |
562 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, | 565 static base::SmartArrayPointer<char> GetLocalizedMessage(Isolate* isolate, |
563 Handle<Object> data); | 566 Handle<Object> data); |
564 }; | 567 }; |
565 | 568 |
566 | 569 |
567 } // namespace internal | 570 } // namespace internal |
568 } // namespace v8 | 571 } // namespace v8 |
569 | 572 |
570 #endif // V8_MESSAGES_H_ | 573 #endif // V8_MESSAGES_H_ |
OLD | NEW |