Implement ECMAScript 2022 class static block (#4841)

Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2021-12-15 15:45:53 +01:00
committed by GitHub
parent c51b268276
commit 53b61c1f6f
15 changed files with 381 additions and 46 deletions
+10
View File
@@ -1806,6 +1806,16 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
goto free_left_value;
}
case VM_OC_CLASS_CALL_STATIC_BLOCK:
{
result = ecma_op_function_call (ecma_get_object_from_value (left_value), frame_ctx_p->this_binding, NULL, 0);
if (ECMA_IS_VALUE_ERROR (result))
{
goto error;
}
goto free_left_value;
}
case VM_OC_PUSH_STATIC_FIELD_FUNC:
{
JERRY_ASSERT (byte_code_start_p[0] == CBC_EXT_OPCODE
+2
View File
@@ -238,6 +238,7 @@ typedef enum
VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */
#endif /* JERRY_DEBUGGER */
#if JERRY_ESNEXT
VM_OC_CLASS_CALL_STATIC_BLOCK, /**< call the class static block */
VM_OC_DEFINE_FIELD, /**< define class field */
VM_OC_PRIVATE_PROP_REFERENCE, /**< reference to class private method */
VM_OC_ASSIGN_PRIVATE, /**< assign to private field */
@@ -333,6 +334,7 @@ typedef enum
VM_OC_BREAKPOINT_DISABLED = VM_OC_NONE, /**< disabled breakpoint for debugger is unused */
#endif /* !JERRY_DEBUGGER */
#if !JERRY_ESNEXT
VM_OC_CLASS_CALL_STATIC_BLOCK = VM_OC_NONE, /**< call the class static block */
VM_OC_DEFINE_FIELD = VM_OC_NONE, /**< define class field */
VM_OC_PRIVATE_PROP_REFERENCE = VM_OC_NONE, /* reference to class private method */
VM_OC_ASSIGN_PRIVATE = VM_OC_NONE, /**< assign to private field */