Add support for function argument initializers. (#2571)

EcmaScript 2015 14.1.

Note: arrow functions with default arguments are not supported yet.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-10-30 10:48:35 +01:00
committed by László Langó
parent aeddb1cd88
commit 83fc0aa04f
8 changed files with 164 additions and 18 deletions
+6
View File
@@ -1038,6 +1038,12 @@ parser_error_to_string (parser_error_t error) /**< error code */
{
return "Duplicated label.";
}
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER
case PARSER_ERR_DUPLICATED_ARGUMENT_NAMES:
{
return "Duplicated function argument names are not allowed here.";
}
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER */
case PARSER_ERR_OBJECT_PROPERTY_REDEFINED:
{
return "Property of object literal redefined.";