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
+1
View File
@@ -94,6 +94,7 @@ typedef enum
PARSER_ERR_DUPLICATED_PROTO, /**< duplicated __proto__ fields are not allowed */
PARSER_ERR_INVALID_LHS_ASSIGNMENT, /**< invalid LeftHandSide in assignment */
PARSER_ERR_INVALID_LHS_POSTFIX_OP, /**< invalid LeftHandSide expression in postfix operation */
PARSER_ERR_INVALID_LHS_PREFIX_OP, /**< invalid LeftHandSide expression in prefix operation */
PARSER_ERR_INVALID_LHS_FOR_LOOP, /**< invalid LeftHandSide in for-loop */
#endif /* JERRY_ESNEXT */
PARSER_ERR_DELETE_IDENT_NOT_ALLOWED, /**< identifier delete is not allowed in strict mode */