Просмотр исходного кода

LibJS: Remove redundant exception check from ClassExpression::execute()

as_object() cannot fail, leftover from ea55453.
Linus Groh 4 лет назад
Родитель
Сommit
f37d3f25e6
1 измененных файлов с 1 добавлено и 4 удалено
  1. 1 4
      Userland/Libraries/LibJS/AST.cpp

+ 1 - 4
Userland/Libraries/LibJS/AST.cpp

@@ -825,11 +825,8 @@ Value ClassExpression::execute(Interpreter& interpreter, GlobalObject& global_ob
                 interpreter.vm().throw_exception<TypeError>(global_object, ErrorType::ClassExtendsValueInvalidPrototype, super_constructor_prototype_value.to_string_without_side_effects());
                 interpreter.vm().throw_exception<TypeError>(global_object, ErrorType::ClassExtendsValueInvalidPrototype, super_constructor_prototype_value.to_string_without_side_effects());
                 return {};
                 return {};
             }
             }
-            if (super_constructor_prototype_value.is_object()) {
+            if (super_constructor_prototype_value.is_object())
                 super_constructor_prototype = &super_constructor_prototype_value.as_object();
                 super_constructor_prototype = &super_constructor_prototype_value.as_object();
-                if (interpreter.exception())
-                    return {};
-            }
         }
         }
         prototype->set_prototype(super_constructor_prototype);
         prototype->set_prototype(super_constructor_prototype);