mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibGC: Delete operators ! and bool from GC::Ref
The GC::Ref smart pointer is always non-null, so there's no need for it to be convertible to bool. This exposed a small number of unnecessary null checks which we remove.
This commit is contained in:
parent
e4e18ca84b
commit
3fb678b376
|
|
@ -71,6 +71,9 @@ public:
|
|||
|
||||
operator T&() const { return *m_ptr; }
|
||||
|
||||
operator bool() const = delete;
|
||||
bool operator!() const = delete;
|
||||
|
||||
private:
|
||||
T* m_ptr { nullptr };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -322,7 +322,6 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::create_class_const
|
|||
}
|
||||
|
||||
auto prototype = Object::create_prototype(realm, proto_parent);
|
||||
VERIFY(prototype);
|
||||
|
||||
// FIXME: Step 14.a is done in the parser. By using a synthetic super(...args) which does not call @@iterator of %Array.prototype%
|
||||
auto const& constructor = *m_constructor;
|
||||
|
|
|
|||
|
|
@ -1344,7 +1344,6 @@ static Value instantiate_ordinary_function_expression(Interpreter& interpreter,
|
|||
|
||||
auto environment = GC::Ref { *interpreter.running_execution_context().lexical_environment };
|
||||
if (has_own_name) {
|
||||
VERIFY(environment);
|
||||
environment = new_declarative_environment(*environment);
|
||||
MUST(environment->create_immutable_binding(interpreter.vm(), own_name, false));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user