Add iterator close support for array destructuring (#3337)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
Zoltan Herczeg
parent
6b43ef8605
commit
2ddf134cef
@@ -1965,6 +1965,17 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
*stack_top_p++ = value;
|
||||
continue;
|
||||
}
|
||||
case VM_OC_ITERATOR_CLOSE:
|
||||
{
|
||||
result = ecma_op_iterator_close (left_value);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (result))
|
||||
{
|
||||
goto error;
|
||||
}
|
||||
|
||||
goto free_left_value;
|
||||
}
|
||||
case VM_OC_DEFAULT_INITIALIZER:
|
||||
{
|
||||
JERRY_ASSERT (stack_top_p > frame_ctx_p->registers_p + register_end);
|
||||
@@ -3883,6 +3894,8 @@ error:
|
||||
JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_VM_EXCEPTION_THROWN);
|
||||
#endif /* ENABLED (JERRY_DEBUGGER) */
|
||||
|
||||
JERRY_CONTEXT (status_flags) &= (uint32_t) ~ECMA_STATUS_EXCEPTION;
|
||||
|
||||
byte_code_p = frame_ctx_p->byte_code_p;
|
||||
|
||||
if (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_FINALLY_THROW)
|
||||
|
||||
@@ -250,6 +250,7 @@ typedef enum
|
||||
VM_OC_PUSH_SPREAD_ELEMENT, /**< push spread element */
|
||||
VM_OC_GET_ITERATOR, /**< GetIterator abstract operation */
|
||||
VM_OC_ITERATOR_STEP, /**< IteratorStep abstract operation */
|
||||
VM_OC_ITERATOR_CLOSE, /**< IteratorClose abstract operation */
|
||||
VM_OC_DEFAULT_INITIALIZER, /**< default initializer inside a pattern */
|
||||
VM_OC_REST_INITIALIZER, /**< create rest object inside an array pattern */
|
||||
VM_OC_INITIALIZER_PUSH_PROP, /**< push property for object initializer */
|
||||
@@ -299,6 +300,7 @@ typedef enum
|
||||
VM_OC_PUSH_SPREAD_ELEMENT = VM_OC_NONE, /**< push spread element */
|
||||
VM_OC_GET_ITERATOR = VM_OC_NONE, /**< GetIterator abstract operation */
|
||||
VM_OC_ITERATOR_STEP = VM_OC_NONE, /**< IteratorStep abstract operation */
|
||||
VM_OC_ITERATOR_CLOSE = VM_OC_NONE, /**< IteratorClose abstract operation */
|
||||
VM_OC_DEFAULT_INITIALIZER = VM_OC_NONE, /**< default initializer inside a pattern */
|
||||
VM_OC_REST_INITIALIZER = VM_OC_NONE, /**< create rest object inside an array pattern */
|
||||
VM_OC_INITIALIZER_PUSH_PROP = VM_OC_NONE, /**< push property for object initializer */
|
||||
|
||||
Reference in New Issue
Block a user