Improve delete property with undefined base (#3312)

This patch finally resolves #2891 also the removes the related bytecode since it has become unnecessary.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-11-14 13:53:52 +01:00
committed by Dániel Bátyai
parent 204de302aa
commit be95aa33b4
6 changed files with 38 additions and 14 deletions
+8 -2
View File
@@ -201,8 +201,14 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
else
{
/* Invalid LeftHandSide expression. */
parser_emit_cbc_ext (context_p, (opcode == CBC_DELETE_PUSH_RESULT) ? CBC_EXT_PUSH_UNDEFINED_BASE
: CBC_EXT_THROW_REFERENCE_ERROR);
if (opcode == CBC_DELETE_PUSH_RESULT)
{
parser_emit_cbc (context_p, CBC_POP);
parser_emit_cbc (context_p, CBC_PUSH_TRUE);
return;
}
parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
}
parser_emit_cbc (context_p, (uint16_t) opcode);