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
@@ -33,6 +33,7 @@ function CheckSyntaxError (str)
CheckSyntaxError ('function x (a, b, ...c, d) {}');
CheckSyntaxError ('function x (... c = 5) {}');
CheckSyntaxError ('function x (...) {}');
CheckSyntaxError ('function x (a, a, ...a) {}');
CheckSyntaxError ('"use strict" function x (...arguments) {}');
rest_params = ['hello', true, 7, {}, [], function () {}];