Add duplicated argument check for function rest parameter (#2740)

Also add a missing word from `PARSER_ERR_FORMAL_PARAM_AFTER_REST_PARAMETER` error message.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-01-31 14:15:42 +01:00
committed by László Langó
parent 1ff322b72f
commit ca8442c523
4 changed files with 16 additions and 5 deletions
+4 -2
View File
@@ -119,9 +119,11 @@ typedef enum
PARSER_ERR_INVALID_RETURN, /**< return must be inside a function */
PARSER_ERR_INVALID_RIGHT_SQUARE, /**< right square must terminate a block */
PARSER_ERR_DUPLICATED_LABEL, /**< duplicated label */
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER
#if (!defined (CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER) \
|| !defined (CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER))
PARSER_ERR_DUPLICATED_ARGUMENT_NAMES, /**< duplicated argument names */
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER */
#endif /* (!defined (CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER)
|| !defined (CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER)) */
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER
PARSER_ERR_FORMAL_PARAM_AFTER_REST_PARAMETER, /**< formal parameter after rest parameter */
PARSER_ERR_REST_PARAMETER_DEFAULT_INITIALIZER, /**< rest parameter default initializer */