Support methods for object initializers. (#2567)
MethodDefinition in ES-2015 12.2.6. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Akos Kiss
parent
ffbd6e6c5c
commit
93567fbb8f
@@ -403,6 +403,13 @@ parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
|
||||
|
||||
JERRY_ASSERT (stack_top == SCAN_STACK_OBJECT_LITERAL);
|
||||
|
||||
if (context_p->token.type == LEXER_LEFT_PAREN)
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_PROPERTY);
|
||||
*mode = SCAN_MODE_FUNCTION_ARGUMENTS;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (context_p->token.type != LEXER_COLON)
|
||||
{
|
||||
parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
|
||||
@@ -916,6 +923,16 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
}
|
||||
|
||||
lexer_next_token (context_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
if (context_p->token.type == LEXER_LEFT_PAREN)
|
||||
{
|
||||
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_PROPERTY);
|
||||
mode = SCAN_MODE_FUNCTION_ARGUMENTS;
|
||||
continue;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER */
|
||||
|
||||
if (context_p->token.type != LEXER_COLON)
|
||||
{
|
||||
parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
|
||||
|
||||
Reference in New Issue
Block a user