Implement nullish coalescing operator (#3997)

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
kisbg
2020-07-17 15:42:51 +02:00
committed by GitHub
parent f60e16d9d5
commit dfd9d4497a
13 changed files with 323 additions and 72 deletions
+4
View File
@@ -161,6 +161,9 @@ typedef enum
VM_OC_ERROR, /**< error while the vm_loop is suspended */
VM_OC_JUMP, /**< jump */
#if ENABLED (JERRY_ESNEXT)
VM_OC_BRANCH_IF_NULLISH, /** branch if undefined or null */
#endif /* ENABLED (JERRY_ESNEXT) */
VM_OC_BRANCH_IF_STRICT_EQUAL, /**< branch if strict equal */
/* These four opcodes must be in this order. */
@@ -296,6 +299,7 @@ typedef enum
{
#if !ENABLED (JERRY_ESNEXT)
VM_OC_EXP = VM_OC_NONE, /**< exponentiation */
VM_OC_BRANCH_IF_NULLISH = VM_OC_NONE, /** branch if undefined or null */
#endif /* !ENABLED (JERRY_ESNEXT) */
#if !ENABLED (JERRY_DEBUGGER)
VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */