Implement parsing await. (#3738)

Several bugs fixed for parsing yield as well.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-05-15 22:26:05 +02:00
committed by GitHub
parent a6f6bce6f0
commit 1f00d750b7
21 changed files with 569 additions and 135 deletions
+6 -2
View File
@@ -1990,8 +1990,12 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
frame_ctx_p->call_operation = VM_EXEC_RETURN;
frame_ctx_p->byte_code_p = byte_code_p;
frame_ctx_p->stack_top_p = stack_top_p;
return left_value;
frame_ctx_p->stack_top_p = --stack_top_p;
return *stack_top_p;
}
case VM_OC_AWAIT:
{
continue;
}
case VM_OC_EXT_RETURN:
{
+2
View File
@@ -265,6 +265,7 @@ typedef enum
VM_OC_SPREAD_ARGUMENTS, /**< perform function call/construct with spreaded arguments */
VM_OC_CREATE_GENERATOR, /**< create a generator object */
VM_OC_YIELD, /**< yield operation */
VM_OC_AWAIT, /**< await operation */
VM_OC_EXT_RETURN, /**< return which also clears the stack */
VM_OC_RETURN_PROMISE, /**< return from an async function */
VM_OC_STRING_CONCAT, /**< string concatenation */
@@ -329,6 +330,7 @@ typedef enum
VM_OC_SPREAD_ARGUMENTS = VM_OC_NONE, /**< perform function call/construct with spreaded arguments */
VM_OC_CREATE_GENERATOR = VM_OC_NONE, /**< create a generator object */
VM_OC_YIELD = VM_OC_NONE, /**< yield operation */
VM_OC_AWAIT = VM_OC_NONE, /**< await operation */
VM_OC_EXT_RETURN = VM_OC_NONE, /**< return which also clears the stack */
VM_OC_RETURN_PROMISE = VM_OC_NONE, /**< return from an async function */
VM_OC_STRING_CONCAT = VM_OC_NONE, /**< string concatenation */