mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00: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: 4d6502de42
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
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