diff options
author | davidot <david.tuin@gmail.com> | 2021-08-14 17:08:09 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-16 23:20:04 +0100 |
commit | 4d6502de423bdf7a278d67fa2ebb515fd834ce41 (patch) | |
tree | 4266a8f4b4c1e372e1326701ec6154f247db6b2e /Userland/Libraries/LibJS | |
parent | a8b25d6c36e2824eef954a056f2bf0688d616601 (diff) | |
download | serenity-4d6502de423bdf7a278d67fa2ebb515fd834ce41.zip |
LibJS: Disallow standalone super expression
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Parser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index 303cf457a2..962d228598 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -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) { |