@@ -88,8 +88,6 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
8888 if (PARSER_IS_PUSH_LITERAL (context_p -> last_cbc_opcode )
8989 && context_p -> last_cbc .literal_type == LEXER_IDENT_LITERAL )
9090 {
91- JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_LITERAL , opcode + CBC_UNARY_LVALUE_WITH_IDENT ));
92-
9391 if (context_p -> status_flags & PARSER_IS_STRICT )
9492 {
9593 if (context_p -> last_cbc .literal_object_type != LEXER_LITERAL_OBJECT_ANY )
@@ -107,17 +105,41 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
107105 }
108106 parser_raise_error (context_p , error );
109107 }
110- if (opcode == CBC_DELETE )
108+ if (opcode == CBC_DELETE_PUSH_RESULT )
111109 {
112110 parser_raise_error (context_p , PARSER_ERR_DELETE_IDENT_NOT_ALLOWED );
113111 }
114112 }
115113
116- if (opcode == CBC_DELETE )
114+ if (opcode == CBC_DELETE_PUSH_RESULT )
117115 {
118116 context_p -> status_flags |= PARSER_LEXICAL_ENV_NEEDED ;
117+
118+ if (context_p -> last_cbc_opcode == CBC_PUSH_LITERAL )
119+ {
120+ context_p -> last_cbc_opcode = CBC_DELETE_IDENT_PUSH_RESULT ;
121+ }
122+ else if (context_p -> last_cbc_opcode == CBC_PUSH_TWO_LITERALS )
123+ {
124+ context_p -> last_cbc_opcode = CBC_PUSH_LITERAL ;
125+ parser_emit_cbc_literal (context_p ,
126+ CBC_DELETE_IDENT_PUSH_RESULT ,
127+ context_p -> last_cbc .value );
128+ }
129+ else
130+ {
131+ JERRY_ASSERT (context_p -> last_cbc_opcode == CBC_PUSH_THREE_LITERALS );
132+
133+ context_p -> last_cbc_opcode = CBC_PUSH_TWO_LITERALS ;
134+ parser_emit_cbc_literal (context_p ,
135+ CBC_DELETE_IDENT_PUSH_RESULT ,
136+ context_p -> last_cbc .third_literal_index );
137+ }
138+ return ;
119139 }
120140
141+ JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_LITERAL , opcode + CBC_UNARY_LVALUE_WITH_IDENT ));
142+
121143 if (context_p -> last_cbc_opcode == CBC_PUSH_LITERAL )
122144 {
123145 context_p -> last_cbc_opcode = (uint16_t ) (opcode + CBC_UNARY_LVALUE_WITH_IDENT );
@@ -169,8 +191,8 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
169191 default :
170192 {
171193 /* Invalid LeftHandSide expression. */
172- parser_emit_cbc_ext (context_p , (opcode == CBC_DELETE ) ? CBC_EXT_PUSH_UNDEFINED_BASE
173- : CBC_EXT_THROW_REFERENCE_ERROR );
194+ parser_emit_cbc_ext (context_p , (opcode == CBC_DELETE_PUSH_RESULT ) ? CBC_EXT_PUSH_UNDEFINED_BASE
195+ : CBC_EXT_THROW_REFERENCE_ERROR );
174196 break ;
175197 }
176198 }
@@ -505,7 +527,7 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
505527
506528 if (lexer_construct_number_object (context_p , PARSER_TRUE , is_negative_number ))
507529 {
508- JERRY_ASSERT (context_p -> lit_object .index < CBC_PUSH_NUMBER_1_RANGE_END );
530+ JERRY_ASSERT (context_p -> lit_object .index <= CBC_PUSH_NUMBER_BYTE_RANGE_END );
509531
510532 if (context_p -> lit_object .index == 0 )
511533 {
@@ -949,7 +971,14 @@ parser_process_unary_expression (parser_context_t *context_p) /**< context */
949971
950972 if (LEXER_IS_UNARY_LVALUE_OP_TOKEN (token ))
951973 {
952- token = (uint8_t ) (LEXER_UNARY_LVALUE_OP_TOKEN_TO_OPCODE (token ));
974+ if (token == LEXER_KEYW_DELETE )
975+ {
976+ token = CBC_DELETE_PUSH_RESULT ;
977+ }
978+ else
979+ {
980+ token = (uint8_t ) (LEXER_UNARY_LVALUE_OP_TOKEN_TO_OPCODE (token ));
981+ }
953982 parser_emit_unary_lvalue_opcode (context_p , (cbc_opcode_t ) token );
954983 }
955984 else
0 commit comments