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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user