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:
parent
a8b25d6c36
commit
4d6502de42
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue