Fix "Invalid prefix operation" errors (#4577)

`--(-a);` returned with a postfix error before this patch.
The changes introduce a new warning for prefix errors, and
returns with the corresponding one based on current opcode.

JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
This commit is contained in:
Tóth Béla
2021-02-08 16:13:37 +01:00
committed by GitHub
parent b1f73e698a
commit 35ecf4c4a3
3 changed files with 13 additions and 1 deletions
+4
View File
@@ -1110,6 +1110,10 @@ parser_error_to_string (parser_error_t error) /**< error code */
{
return "Invalid left-hand side expression in postfix operation";
}
case PARSER_ERR_INVALID_LHS_PREFIX_OP:
{
return "Invalid left-hand side expression in prefix operation";
}
case PARSER_ERR_INVALID_LHS_FOR_LOOP:
{
return "Invalid left-hand-side in for-loop";