LibJS: Disallow standalone super expression

This commit is contained in:
davidot 2021-08-14 17:08:09 +02:00 committed by Linus Groh
parent a8b25d6c36
commit 4d6502de42
Notes: sideshowbarker 2024-07-18 05:36:16 +09:00

View File

@ -1297,6 +1297,9 @@ NonnullRefPtr<Expression> Parser::parse_expression(int min_precedence, Associati
}
}
if (is<SuperExpression>(*expression))
syntax_error("'super' keyword unexpected here");
check_for_invalid_object_property(expression);
if (match(TokenType::Comma) && min_precedence <= 1) {