Fix invalid destructuring function arguments parsing (#4074)

This patch fixes #4016 and fixes #4019.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-07-28 10:41:45 +02:00
committed by GitHub
parent 227007eda7
commit 9872c441e3
3 changed files with 40 additions and 2 deletions
+4 -1
View File
@@ -3080,7 +3080,10 @@ parser_pattern_get_target (parser_context_t *context_p, /**< context */
}
else
{
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_INITIALIZER);
if (context_p->next_scanner_info_p->type != SCANNER_TYPE_INITIALIZER)
{
parser_raise_error (context_p, PARSER_ERR_INVALID_DESTRUCTURING_PATTERN);
}
scanner_get_location (&start_location, context_p);
scanner_set_location (context_p, &((scanner_location_info_t *) context_p->next_scanner_info_p)->location);