mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibJS: Disallow standalone super expression
This commit is contained in:
parent
a8b25d6c36
commit
4d6502de42
Notes:
sideshowbarker
2024-07-18 05:36:16 +09:00
Author: https://github.com/davidot Commit: https://github.com/SerenityOS/serenity/commit/4d6502de423 Pull-request: https://github.com/SerenityOS/serenity/pull/9085 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/linusg ✅ Reviewed-by: https://github.com/trflynn89
@ -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…
Reference in New Issue
Block a user