2 * @fileoverview Error messages returned by the parser.
3 * @author Nicholas C. Zakas
4 * @copyright 2014 Nicholas C. Zakas. All rights reserved.
5 * @copyright 2011-2013 Ariya Hidayat <ariya.hidayat@gmail.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 //------------------------------------------------------------------------------
32 //------------------------------------------------------------------------------
36 //------------------------------------------------------------------------------
38 //------------------------------------------------------------------------------
40 // error messages should be identical to V8 where possible
42 UnexpectedToken: "Unexpected token %0",
43 UnexpectedNumber: "Unexpected number",
44 UnexpectedString: "Unexpected string",
45 UnexpectedIdentifier: "Unexpected identifier",
46 UnexpectedReserved: "Unexpected reserved word",
47 UnexpectedTemplate: "Unexpected quasi %0",
48 UnexpectedEOS: "Unexpected end of input",
49 NewlineAfterThrow: "Illegal newline after throw",
50 InvalidRegExp: "Invalid regular expression",
51 InvalidRegExpFlag: "Invalid regular expression flag",
52 UnterminatedRegExp: "Invalid regular expression: missing /",
53 InvalidLHSInAssignment: "Invalid left-hand side in assignment",
54 InvalidLHSInFormalsList: "Invalid left-hand side in formals list",
55 InvalidLHSInForIn: "Invalid left-hand side in for-in",
56 MultipleDefaultsInSwitch: "More than one default clause in switch statement",
57 NoCatchOrFinally: "Missing catch or finally after try",
58 NoUnintializedConst: "Const must be initialized",
59 UnknownLabel: "Undefined label '%0'",
60 Redeclaration: "%0 '%1' has already been declared",
61 IllegalContinue: "Illegal continue statement",
62 IllegalBreak: "Illegal break statement",
63 IllegalReturn: "Illegal return statement",
64 IllegalYield: "Illegal yield expression",
65 IllegalSpread: "Illegal spread element",
66 StrictModeWith: "Strict mode code may not include a with statement",
67 StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode",
68 StrictVarName: "Variable name may not be eval or arguments in strict mode",
69 StrictParamName: "Parameter name eval or arguments is not allowed in strict mode",
70 StrictParamDupe: "Strict mode function may not have duplicate parameter names",
71 TemplateOctalLiteral: "Octal literals are not allowed in template strings.",
72 ParameterAfterRestParameter: "Rest parameter must be final parameter of an argument list",
73 DefaultRestParameter: "Rest parameter can not have a default value",
74 ElementAfterSpreadElement: "Spread must be the final element of an element list",
75 ObjectPatternAsRestParameter: "Invalid rest parameter",
76 ObjectPatternAsSpread: "Invalid spread argument",
77 StrictFunctionName: "Function name may not be eval or arguments in strict mode",
78 StrictOctalLiteral: "Octal literals are not allowed in strict mode.",
79 StrictDelete: "Delete of an unqualified identifier in strict mode.",
80 StrictDuplicateProperty: "Duplicate data property in object literal not allowed in strict mode",
81 DuplicatePrototypeProperty: "Duplicate '__proto__' property in object literal are not allowed",
82 ConstructorSpecialMethod: "Class constructor may not be an accessor",
83 DuplicateConstructor: "A class may only have one constructor",
84 StaticPrototype: "Classes may not have static property named prototype",
85 AccessorDataProperty: "Object literal may not have data and accessor property with the same name",
86 AccessorGetSet: "Object literal may not have multiple get/set accessors with the same name",
87 StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode",
88 StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode",
89 StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode",
90 StrictReservedWord: "Use of future reserved word in strict mode",
91 InvalidJSXAttributeValue: "JSX value should be either an expression or a quoted JSX text",
92 ExpectedJSXClosingTag: "Expected corresponding JSX closing tag for %0",
93 AdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag",
94 MissingFromClause: "Missing from clause",
95 NoAsAfterImportNamespace: "Missing as after import *",
96 InvalidModuleSpecifier: "Invalid module specifier",
97 IllegalImportDeclaration: "Illegal import declaration",
98 IllegalExportDeclaration: "Illegal export declaration"