Fix error for duplicated names in ArrowFunction paremeter list (#3597)

Duplicated parameter names are not allowed for arrow functions
regardless of strict mode.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
Rafal Walczyna
2020-03-03 09:18:27 +01:00
committed by GitHub
parent 34edf53753
commit 3c8a6ca71d
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -1809,7 +1809,8 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
if (JERRY_UNLIKELY (context_p->lit_object.literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT))
{
#if ENABLED (JERRY_ES2015)
if (context_p->status_flags & PARSER_FUNCTION_HAS_NON_SIMPLE_PARAM)
if ((context_p->status_flags & PARSER_FUNCTION_HAS_NON_SIMPLE_PARAM)
|| (context_p->status_flags & PARSER_IS_ARROW_FUNCTION))
{
parser_raise_error (context_p, PARSER_ERR_DUPLICATED_ARGUMENT_NAMES);
}