From f37d3f25e687fb8c17f8cc676f18e5658b452fc0 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 24 Jan 2021 00:15:35 +0100 Subject: [PATCH] LibJS: Remove redundant exception check from ClassExpression::execute() as_object() cannot fail, leftover from ea55453. --- Userland/Libraries/LibJS/AST.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index bd1818aab2..3e327ac365 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -825,11 +825,8 @@ Value ClassExpression::execute(Interpreter& interpreter, GlobalObject& global_ob interpreter.vm().throw_exception(global_object, ErrorType::ClassExtendsValueInvalidPrototype, super_constructor_prototype_value.to_string_without_side_effects()); return {}; } - if (super_constructor_prototype_value.is_object()) { + if (super_constructor_prototype_value.is_object()) super_constructor_prototype = &super_constructor_prototype_value.as_object(); - if (interpreter.exception()) - return {}; - } } prototype->set_prototype(super_constructor_prototype);