Implement spread operator for function call arguments (#3329)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
Dániel Bátyai
parent
bf630c0c54
commit
22766a855e
@@ -443,8 +443,14 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
case LEXER_COMMA:
|
||||
{
|
||||
/* Elision. */
|
||||
if (stack_top != SCAN_STACK_ARRAY_LITERAL)
|
||||
/* Elision or spread arguments */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
bool raise_error = (stack_top != SCAN_STACK_PAREN_EXPRESSION && stack_top != SCAN_STACK_ARRAY_LITERAL);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
bool raise_error = stack_top != SCAN_STACK_ARRAY_LITERAL;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
|
||||
if (raise_error)
|
||||
{
|
||||
scanner_raise_error (context_p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user