Invalid regexp literals should throw syntax error in ES11 (#4506)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2021-01-19 16:20:23 +01:00
committed by GitHub
parent d97540e883
commit 3e548401fd
11 changed files with 12 additions and 536 deletions
-8
View File
@@ -1740,14 +1740,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
result = ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned."));
goto error;
}
case VM_OC_THROW_SYNTAX_ERROR:
{
ecma_string_t *msg_p = ecma_get_string_from_value (left_value);
ecma_object_t *error_obj_p = ecma_new_standard_error (ECMA_ERROR_SYNTAX, msg_p);
jcontext_raise_exception (ecma_make_object_value (error_obj_p));
result = ECMA_VALUE_ERROR;
goto error;
}
case VM_OC_COPY_TO_GLOBAL:
{
uint32_t literal_index;
-2
View File
@@ -243,7 +243,6 @@ typedef enum
VM_OC_ASSIGN_LET_CONST, /**< assign values to let/const declarations */
VM_OC_INIT_BINDING, /**< create and intialize a binding */
VM_OC_THROW_CONST_ERROR, /**< throw invalid assignment to const variable error */
VM_OC_THROW_SYNTAX_ERROR, /**< throw syntax error */
VM_OC_COPY_TO_GLOBAL, /**< copy value to global lex env */
VM_OC_COPY_FROM_ARG, /**< copy value from arg lex env */
VM_OC_CLONE_CONTEXT, /**< clone lexical environment with let/const declarations */
@@ -331,7 +330,6 @@ typedef enum
VM_OC_ASSIGN_LET_CONST = VM_OC_NONE, /**< assign values to let/const declarations */
VM_OC_INIT_BINDING = VM_OC_NONE, /**< create and intialize a binding */
VM_OC_THROW_CONST_ERROR = VM_OC_NONE, /**< throw invalid assignment to const variable error */
VM_OC_THROW_SYNTAX_ERROR = VM_OC_NONE, /**< throw syntax error */
VM_OC_COPY_TO_GLOBAL = VM_OC_NONE, /**< copy value to global lex env */
VM_OC_COPY_FROM_ARG = VM_OC_NONE, /**< copy value from arg lex env */
VM_OC_CLONE_CONTEXT = VM_OC_NONE, /**< clone lexical environment with let/const declarations */