Implement rest parameter support for destructuring object patterns. (#4318)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-10-29 10:49:08 +01:00
committed by GitHub
parent 484e999dec
commit c7986fd2c5
22 changed files with 632 additions and 528 deletions
+20
View File
@@ -452,6 +452,26 @@ parser_stack_change_last_uint8 (parser_context_t *context_p, /**< context */
context_p->stack_top_uint8 = new_value;
} /* parser_stack_change_last_uint8 */
/**
* Get the uint8 value before the top of the stack.
*
* Pointer to the uint8 value
*/
uint8_t *
parser_stack_get_prev_uint8 (parser_context_t *context_p) /**< context */
{
parser_mem_page_t *page_p = context_p->stack.first_p;
JERRY_ASSERT (page_p != NULL && (context_p->stack.last_position >= 2 || page_p->next_p != NULL));
if (context_p->stack.last_position >= 2)
{
return page_p->bytes + (context_p->stack.last_position - 2);
}
return page_p->next_p->bytes + (PARSER_STACK_PAGE_SIZE - 1);
} /* parser_stack_get_prev_uint8 */
/**
* Pushes an uint16_t value onto the stack.
*/