mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibJS: Make Cell::initialize() return void
Stop worrying about tiny OOMs. Work towards #20405
This commit is contained in:
parent
fde26c53f0
commit
18c54d8d40
804 changed files with 1330 additions and 2171 deletions
|
@ -27,12 +27,12 @@ $262Object::$262Object(Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
ThrowCompletionOr<void> $262Object::initialize(Realm& realm)
|
||||
void $262Object::initialize(Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
|
||||
m_agent = MUST_OR_THROW_OOM(vm().heap().allocate<AgentObject>(realm, realm));
|
||||
m_is_htmldda = MUST_OR_THROW_OOM(vm().heap().allocate<IsHTMLDDA>(realm, realm));
|
||||
m_agent = MUST(vm().heap().allocate<AgentObject>(realm, realm));
|
||||
m_is_htmldda = MUST(vm().heap().allocate<IsHTMLDDA>(realm, realm));
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(realm, "clearKeptObjects", clear_kept_objects, 0, attr);
|
||||
|
@ -44,8 +44,6 @@ ThrowCompletionOr<void> $262Object::initialize(Realm& realm)
|
|||
define_direct_property("gc", realm.global_object().get_without_side_effects("gc"), attr);
|
||||
define_direct_property("global", &realm.global_object(), attr);
|
||||
define_direct_property("IsHTMLDDA", m_is_htmldda, attr);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void $262Object::visit_edges(Cell::Visitor& visitor)
|
||||
|
@ -68,7 +66,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm)
|
|||
VERIFY(realm_global_object);
|
||||
realm->set_global_object(realm_global_object, nullptr);
|
||||
set_default_global_bindings(*realm);
|
||||
MUST_OR_THROW_OOM(realm_global_object->initialize(*realm));
|
||||
realm_global_object->initialize(*realm);
|
||||
return Value(realm_global_object->$262());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue