Set constructor to prototype for ES2015 Classes (#2818)

JerryScript-DCO-1.0-Signed-off-by: legendecas legendecas@gmail.com
This commit is contained in:
legendecas
2019-04-29 19:36:23 +08:00
committed by László Langó
parent 56b6d3a45d
commit 097e1862d2
5 changed files with 29 additions and 19 deletions
+1 -2
View File
@@ -363,7 +363,6 @@ static void
parser_parse_class_literal (parser_context_t *context_p) /**< context */
{
JERRY_ASSERT (context_p->token.type == LEXER_LEFT_BRACE);
parser_emit_cbc (context_p, CBC_CREATE_OBJECT);
bool super_called = false;
uint32_t status_flags = PARSER_IS_FUNCTION | PARSER_IS_CLOSURE;
@@ -605,7 +604,7 @@ parser_parse_class (parser_context_t *context_p, /**< context */
parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
}
parser_emit_cbc_ext (context_p, CBC_EXT_PUSH_CLASS_CONSTRUCTOR);
parser_emit_cbc_ext (context_p, CBC_EXT_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE);
bool is_strict = context_p->status_flags & PARSER_IS_STRICT;