mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Change error message description (#4785)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
parent
2a82da62ad
commit
7d355b0f8e
@ -2369,7 +2369,7 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
|
||||
{
|
||||
bool is_left_hand_side = (*grouping_level_p == PARSE_EXPR_LEFT_HAND_SIDE);
|
||||
parser_raise_error (context_p, (is_left_hand_side ? PARSER_ERR_LEFT_HAND_SIDE_EXP_EXPECTED
|
||||
: PARSER_ERR_PRIMARY_EXP_EXPECTED));
|
||||
: PARSER_ERR_UNEXPECTED_END));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1174,9 +1174,9 @@ parser_error_to_string (parser_error_t error) /**< error code */
|
||||
{
|
||||
return "Expression expected";
|
||||
}
|
||||
case PARSER_ERR_PRIMARY_EXP_EXPECTED:
|
||||
case PARSER_ERR_UNEXPECTED_END:
|
||||
{
|
||||
return "Primary expression expected";
|
||||
return "Unexpected end of input";
|
||||
}
|
||||
case PARSER_ERR_LEFT_HAND_SIDE_EXP_EXPECTED:
|
||||
{
|
||||
|
||||
@ -110,6 +110,7 @@ typedef enum
|
||||
PARSER_ERR_RIGHT_PAREN_EXPECTED, /**< right paren expected */
|
||||
PARSER_ERR_RIGHT_SQUARE_EXPECTED, /**< right square expected */
|
||||
|
||||
PARSER_ERR_UNEXPECTED_END, /**< unexpected end of input */
|
||||
PARSER_ERR_COLON_EXPECTED, /**< colon expected */
|
||||
PARSER_ERR_COLON_FOR_CONDITIONAL_EXPECTED, /**< colon expected for conditional expression */
|
||||
PARSER_ERR_SEMICOLON_EXPECTED, /**< semicolon expected */
|
||||
@ -120,7 +121,6 @@ typedef enum
|
||||
PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED, /**< object item separator expected */
|
||||
PARSER_ERR_IDENTIFIER_EXPECTED, /**< identifier expected */
|
||||
PARSER_ERR_EXPRESSION_EXPECTED, /**< expression expected */
|
||||
PARSER_ERR_PRIMARY_EXP_EXPECTED, /**< primary expression expected */
|
||||
PARSER_ERR_LEFT_HAND_SIDE_EXP_EXPECTED, /**< left-hand-side expression expected */
|
||||
PARSER_ERR_STATEMENT_EXPECTED, /**< statement expected */
|
||||
PARSER_ERR_PROPERTY_IDENTIFIER_EXPECTED, /**< property identifier expected */
|
||||
|
||||
@ -1065,7 +1065,7 @@ main (void)
|
||||
|
||||
test_syntax_error ("b = 'hello';\nvar a = (;",
|
||||
NULL,
|
||||
"SyntaxError: Primary expression expected [<anonymous>:2:10]",
|
||||
"SyntaxError: Unexpected end of input [<anonymous>:2:10]",
|
||||
false);
|
||||
|
||||
parse_options.options = JERRY_PARSE_HAS_RESOURCE;
|
||||
@ -1073,12 +1073,12 @@ main (void)
|
||||
|
||||
test_syntax_error ("b = 'hello';\nvar a = (;",
|
||||
&parse_options,
|
||||
"SyntaxError: Primary expression expected [filename.js:2:10]",
|
||||
"SyntaxError: Unexpected end of input [filename.js:2:10]",
|
||||
false);
|
||||
|
||||
test_syntax_error ("eval(\"var b;\\nfor (,); \");",
|
||||
&parse_options,
|
||||
"SyntaxError: Primary expression expected [<eval>:2:6]",
|
||||
"SyntaxError: Unexpected end of input [<eval>:2:6]",
|
||||
true);
|
||||
|
||||
parse_options.options |= JERRY_PARSE_HAS_START;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user