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:
Szilagyi Adam
2020-07-06 13:36:28 +02:00
committed by GitHub
parent 97fc48132a
commit 69f917650e
40 changed files with 3362 additions and 37 deletions
+12
View File
@@ -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:
{