1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

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

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) {