Add support for function rest parameter (#2647)

ECMAScript v6, 14.1.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-01-25 09:24:39 +01:00
committed by Akos Kiss
parent a42f239abb
commit 4c1ee94652
14 changed files with 185 additions and 3 deletions
+11
View File
@@ -1152,6 +1152,17 @@ lexer_next_token (parser_context_t *context_p) /**< context */
return;
}
#ifndef CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER
if (length >= 3
&& context_p->source_p[1] == LIT_CHAR_DOT
&& context_p->source_p[2] == LIT_CHAR_DOT)
{
context_p->token.type = LEXER_THREE_DOTS;
length = 3;
break;
}
#endif /* !CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER */
context_p->token.type = LEXER_DOT;
length = 1;
break;