Skip to content

Commit c754d95

Browse files
committed
Fix super keyword parsing for arrow functions.
This patch fixes #2657. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent 0c20f8e commit c754d95

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

jerry-core/parser/js/js-parser-expr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
14071407
{
14081408
if ((lexer_check_next_character (context_p, LIT_CHAR_DOT)
14091409
|| lexer_check_next_character (context_p, LIT_CHAR_LEFT_SQUARE))
1410-
&& context_p->status_flags & (PARSER_CLASS_HAS_SUPER | PARSER_IS_ARROW_FUNCTION))
1410+
&& context_p->status_flags & (PARSER_CLASS_HAS_SUPER))
14111411
{
14121412
if (!LEXER_IS_BINARY_LVALUE_TOKEN (context_p->stack_top_uint8))
14131413
{
@@ -1426,8 +1426,7 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
14261426
}
14271427

14281428
if (lexer_check_next_character (context_p, LIT_CHAR_LEFT_PAREN)
1429-
&& (context_p->status_flags & PARSER_CLASS_HAS_SUPER)
1430-
&& (context_p->status_flags & (PARSER_IS_ARROW_FUNCTION | PARSER_CLASS_CONSTRUCTOR)))
1429+
&& ((context_p->status_flags & PARSER_CLASS_CONSTRUCTOR_SUPER) == PARSER_CLASS_CONSTRUCTOR_SUPER))
14311430
{
14321431
parser_emit_cbc_ext (context_p, CBC_EXT_PUSH_CONSTRUCTOR_SUPER);
14331432
break;

0 commit comments

Comments
 (0)