From 4d6502de423bdf7a278d67fa2ebb515fd834ce41 Mon Sep 17 00:00:00 2001 From: davidot Date: Sat, 14 Aug 2021 17:08:09 +0200 Subject: [PATCH] LibJS: Disallow standalone super expression --- Userland/Libraries/LibJS/Parser.cpp | 3 +++ 1 file changed, 3 insertions(+) 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 Parser::parse_expression(int min_precedence, Associati } } + if (is(*expression)) + syntax_error("'super' keyword unexpected here"); + check_for_invalid_object_property(expression); if (match(TokenType::Comma) && min_precedence <= 1) {