Update parser early return type in ESNEXT (#3742)
This patch updates the early return types in the parser to SyntaxError instead of ReferenceError in ESNEXT This patch also includes a lot of tests for LeftHandSideExpression validation when using the = operator JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -968,6 +968,18 @@ parser_error_to_string (parser_error_t error) /**< error code */
|
||||
{
|
||||
return "Duplicate __proto__ fields are not allowed in object literals.";
|
||||
}
|
||||
case PARSER_ERR_INVALID_LHS_ASSIGNMENT:
|
||||
{
|
||||
return "Invalid left-hand side in assignment.";
|
||||
}
|
||||
case PARSER_ERR_INVALID_LHS_POSTFIX_OP:
|
||||
{
|
||||
return "Invalid left-hand side expression in postfix operation.";
|
||||
}
|
||||
case PARSER_ERR_INVALID_LHS_FOR_LOOP:
|
||||
{
|
||||
return "Invalid left-hand-side in for-loop.";
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case PARSER_ERR_DELETE_IDENT_NOT_ALLOWED:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user