mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:47:34 +00:00
LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate
Callers that are already in a fallible context will now TRY to allocate cells. Callers in infallible contexts get a FIXME.
This commit is contained in:
parent
109b190a19
commit
b75b7f0c0d
178 changed files with 565 additions and 565 deletions
|
@ -115,7 +115,7 @@ JS::NonnullGCPtr<BrowsingContext> BrowsingContext::create_a_new_browsing_context
|
|||
auto realm_execution_context = Bindings::create_a_new_javascript_realm(
|
||||
Bindings::main_thread_vm(),
|
||||
[&](JS::Realm& realm) -> JS::Object* {
|
||||
browsing_context->m_window_proxy = realm.heap().allocate<WindowProxy>(realm, realm);
|
||||
browsing_context->m_window_proxy = realm.heap().allocate<WindowProxy>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// - For the global object, create a new Window object.
|
||||
window = HTML::Window::create(realm);
|
||||
|
|
|
@ -22,21 +22,21 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CanvasGradient>> CanvasGradient::create_rad
|
|||
return WebIDL::IndexSizeError::create(realm, "The r1 passed is less than 0");
|
||||
|
||||
auto radial_gradient = Gfx::CanvasRadialGradientPaintStyle::create(Gfx::FloatPoint { x0, y0 }, r0, Gfx::FloatPoint { x1, y1 }, r1);
|
||||
return realm.heap().allocate<CanvasGradient>(realm, realm, *radial_gradient);
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<CanvasGradient>(realm, realm, *radial_gradient));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createlineargradient
|
||||
JS::NonnullGCPtr<CanvasGradient> CanvasGradient::create_linear(JS::Realm& realm, double x0, double y0, double x1, double y1)
|
||||
{
|
||||
auto linear_gradient = Gfx::CanvasLinearGradientPaintStyle::create(Gfx::FloatPoint { x0, y0 }, Gfx::FloatPoint { x1, y1 });
|
||||
return realm.heap().allocate<CanvasGradient>(realm, realm, *linear_gradient);
|
||||
return realm.heap().allocate<CanvasGradient>(realm, realm, *linear_gradient).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createconicgradient
|
||||
JS::NonnullGCPtr<CanvasGradient> CanvasGradient::create_conic(JS::Realm& realm, double start_angle, double x, double y)
|
||||
{
|
||||
auto conic_gradient = Gfx::CanvasConicGradientPaintStyle::create(Gfx::FloatPoint { x, y }, start_angle);
|
||||
return realm.heap().allocate<CanvasGradient>(realm, realm, *conic_gradient);
|
||||
return realm.heap().allocate<CanvasGradient>(realm, realm, *conic_gradient).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CanvasGradient::CanvasGradient(JS::Realm& realm, Gfx::GradientPaintStyle& gradient)
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<CanvasRenderingContext2D> CanvasRenderingContext2D::create(JS::Realm& realm, HTMLCanvasElement& element)
|
||||
{
|
||||
return realm.heap().allocate<CanvasRenderingContext2D>(realm, realm, element);
|
||||
return realm.heap().allocate<CanvasRenderingContext2D>(realm, realm, element).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CanvasRenderingContext2D::CanvasRenderingContext2D(JS::Realm& realm, HTMLCanvasElement& element)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
CloseEvent* CloseEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<CloseEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<CloseEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CloseEvent* CloseEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init)
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::HTML {
|
|||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMParser>> DOMParser::construct_impl(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<DOMParser>(realm, realm);
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<DOMParser>(realm, realm));
|
||||
}
|
||||
|
||||
DOMParser::DOMParser(JS::Realm& realm)
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::HTML {
|
|||
JS::NonnullGCPtr<DOMStringMap> DOMStringMap::create(DOM::Element& element)
|
||||
{
|
||||
auto& realm = element.realm();
|
||||
return realm.heap().allocate<DOMStringMap>(realm, element);
|
||||
return realm.heap().allocate<DOMStringMap>(realm, element).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
DOMStringMap::DOMStringMap(DOM::Element& element)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
ErrorEvent* ErrorEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<ErrorEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<ErrorEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
ErrorEvent* ErrorEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init)
|
||||
|
|
|
@ -382,13 +382,13 @@ void HTMLInputElement::create_shadow_tree_if_needed()
|
|||
break;
|
||||
}
|
||||
|
||||
auto shadow_root = heap().allocate<DOM::ShadowRoot>(realm(), document(), *this);
|
||||
auto shadow_root = heap().allocate<DOM::ShadowRoot>(realm(), document(), *this).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
auto initial_value = m_value;
|
||||
if (initial_value.is_null())
|
||||
initial_value = DeprecatedString::empty();
|
||||
auto element = document().create_element(HTML::TagNames::div).release_value();
|
||||
MUST(element->set_attribute(HTML::AttributeNames::style, "white-space: pre; padding-top: 1px; padding-bottom: 1px; padding-left: 2px; padding-right: 2px"));
|
||||
m_text_node = heap().allocate<DOM::Text>(realm(), document(), initial_value);
|
||||
m_text_node = heap().allocate<DOM::Text>(realm(), document(), initial_value).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
m_text_node->set_always_editable(m_type != TypeAttributeState::FileUpload);
|
||||
m_text_node->set_owner_input_element({}, *this);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter)
|
||||
{
|
||||
return root.heap().allocate<HTMLOptionsCollection>(root.realm(), root, move(filter));
|
||||
return root.heap().allocate<HTMLOptionsCollection>(root.realm(), root, move(filter)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
HTMLOptionsCollection::HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter)
|
||||
|
|
|
@ -22,7 +22,7 @@ JS::ThrowCompletionOr<void> HTMLTemplateElement::initialize(JS::Realm& realm)
|
|||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLTemplateElementPrototype>(realm, "HTMLTemplateElement"));
|
||||
|
||||
m_content = heap().allocate<DOM::DocumentFragment>(realm, m_document->appropriate_template_contents_owner_document());
|
||||
m_content = MUST_OR_THROW_OOM(heap().allocate<DOM::DocumentFragment>(realm, m_document->appropriate_template_contents_owner_document()));
|
||||
m_content->set_host(this);
|
||||
|
||||
return {};
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<History> History::create(JS::Realm& realm, DOM::Document& document)
|
||||
{
|
||||
return realm.heap().allocate<History>(realm, realm, document);
|
||||
return realm.heap().allocate<History>(realm, realm, document).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
History::History(JS::Realm& realm, DOM::Document& document)
|
||||
|
|
|
@ -28,7 +28,7 @@ JS::GCPtr<ImageData> ImageData::create_with_size(JS::Realm& realm, int width, in
|
|||
auto bitmap_or_error = Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(width, height), 1, width * sizeof(u32), data->data().data());
|
||||
if (bitmap_or_error.is_error())
|
||||
return nullptr;
|
||||
return realm.heap().allocate<ImageData>(realm, realm, bitmap_or_error.release_value(), move(data));
|
||||
return realm.heap().allocate<ImageData>(realm, realm, bitmap_or_error.release_value(), move(data)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
ImageData::ImageData(JS::Realm& realm, NonnullRefPtr<Gfx::Bitmap> bitmap, JS::NonnullGCPtr<JS::Uint8ClampedArray> data)
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<MessageChannel> MessageChannel::construct_impl(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<MessageChannel>(realm, realm);
|
||||
return realm.heap().allocate<MessageChannel>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
MessageChannel::MessageChannel(JS::Realm& realm)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
MessageEvent* MessageEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, MessageEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<MessageEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<MessageEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
MessageEvent* MessageEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MessageEventInit const& event_init)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<MessagePort> MessagePort::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<MessagePort>(realm, realm);
|
||||
return realm.heap().allocate<MessagePort>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
MessagePort::MessagePort(JS::Realm& realm)
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<Navigator> Navigator::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<Navigator>(realm, realm);
|
||||
return realm.heap().allocate<Navigator>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
Navigator::Navigator(JS::Realm& realm)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
PageTransitionEvent* PageTransitionEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<PageTransitionEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<PageTransitionEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PageTransitionEvent* PageTransitionEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init)
|
||||
|
|
|
@ -462,13 +462,13 @@ void HTMLParser::handle_initial(HTMLToken& token)
|
|||
}
|
||||
|
||||
if (token.is_comment()) {
|
||||
auto comment = realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment());
|
||||
auto comment = realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
MUST(document().append_child(*comment));
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.is_doctype()) {
|
||||
auto doctype = realm().heap().allocate<DOM::DocumentType>(realm(), document());
|
||||
auto doctype = realm().heap().allocate<DOM::DocumentType>(realm(), document()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
doctype->set_name(token.doctype_data().name);
|
||||
doctype->set_public_id(token.doctype_data().public_identifier);
|
||||
doctype->set_system_id(token.doctype_data().system_identifier);
|
||||
|
@ -497,7 +497,7 @@ void HTMLParser::handle_before_html(HTMLToken& token)
|
|||
// -> A comment token
|
||||
if (token.is_comment()) {
|
||||
// Insert a comment as the last child of the Document object.
|
||||
auto comment = realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment());
|
||||
auto comment = realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
MUST(document().append_child(*comment));
|
||||
return;
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ AnythingElse:
|
|||
void HTMLParser::insert_comment(HTMLToken& token)
|
||||
{
|
||||
auto adjusted_insertion_location = find_appropriate_place_for_inserting_node();
|
||||
adjusted_insertion_location.parent->insert_before(realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment()), adjusted_insertion_location.insert_before_sibling);
|
||||
adjusted_insertion_location.parent->insert_before(realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment()).release_allocated_value_but_fixme_should_propagate_errors(), adjusted_insertion_location.insert_before_sibling);
|
||||
}
|
||||
|
||||
void HTMLParser::handle_in_head(HTMLToken& token)
|
||||
|
@ -945,7 +945,7 @@ DOM::Text* HTMLParser::find_character_insertion_node()
|
|||
return nullptr;
|
||||
if (adjusted_insertion_location.parent->last_child() && adjusted_insertion_location.parent->last_child()->is_text())
|
||||
return verify_cast<DOM::Text>(adjusted_insertion_location.parent->last_child());
|
||||
auto new_text_node = realm().heap().allocate<DOM::Text>(realm(), document(), "");
|
||||
auto new_text_node = realm().heap().allocate<DOM::Text>(realm(), document(), "").release_allocated_value_but_fixme_should_propagate_errors();
|
||||
MUST(adjusted_insertion_location.parent->append_child(*new_text_node));
|
||||
return new_text_node;
|
||||
}
|
||||
|
@ -1071,7 +1071,7 @@ void HTMLParser::handle_after_body(HTMLToken& token)
|
|||
|
||||
if (token.is_comment()) {
|
||||
auto& insertion_location = m_stack_of_open_elements.first();
|
||||
MUST(insertion_location.append_child(realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment())));
|
||||
MUST(insertion_location.append_child(realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment()).release_allocated_value_but_fixme_should_propagate_errors()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1107,7 +1107,7 @@ void HTMLParser::handle_after_body(HTMLToken& token)
|
|||
void HTMLParser::handle_after_after_body(HTMLToken& token)
|
||||
{
|
||||
if (token.is_comment()) {
|
||||
auto comment = realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment());
|
||||
auto comment = realm().heap().allocate<DOM::Comment>(realm(), document(), token.comment()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
MUST(document().append_child(*comment));
|
||||
return;
|
||||
}
|
||||
|
@ -3181,7 +3181,7 @@ void HTMLParser::handle_after_frameset(HTMLToken& token)
|
|||
void HTMLParser::handle_after_after_frameset(HTMLToken& token)
|
||||
{
|
||||
if (token.is_comment()) {
|
||||
auto comment = document().heap().allocate<DOM::Comment>(document().realm(), document(), token.comment());
|
||||
auto comment = document().heap().allocate<DOM::Comment>(document().realm(), document(), token.comment()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
MUST(document().append_child(comment));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<Path2D> Path2D::construct_impl(JS::Realm& realm, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const& path)
|
||||
{
|
||||
return realm.heap().allocate<Path2D>(realm, realm, path);
|
||||
return realm.heap().allocate<Path2D>(realm, realm, path).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-path2d
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
PromiseRejectionEvent* PromiseRejectionEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<PromiseRejectionEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<PromiseRejectionEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PromiseRejectionEvent* PromiseRejectionEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init)
|
||||
|
|
|
@ -38,7 +38,7 @@ JS::GCPtr<JavaScriptModuleScript> JavaScriptModuleScript::create(DeprecatedStrin
|
|||
auto& realm = settings_object.realm();
|
||||
|
||||
// 2. Let script be a new module script that this algorithm will subsequently initialize.
|
||||
auto script = realm.heap().allocate<JavaScriptModuleScript>(realm, move(base_url), filename, settings_object);
|
||||
auto script = realm.heap().allocate<JavaScriptModuleScript>(realm, move(base_url), filename, settings_object).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// 3. Set script's settings object to settings.
|
||||
// NOTE: This was already done when constructing.
|
||||
|
|
|
@ -38,7 +38,7 @@ void WindowEnvironmentSettingsObject::setup(AK::URL const& creation_url, Nonnull
|
|||
|
||||
// 3. Let settings object be a new environment settings object whose algorithms are defined as follows:
|
||||
// NOTE: See the functions defined for this class.
|
||||
auto settings_object = realm->heap().allocate<WindowEnvironmentSettingsObject>(*realm, window, move(execution_context));
|
||||
auto settings_object = realm->heap().allocate<WindowEnvironmentSettingsObject>(*realm, window, move(execution_context)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// 4. If reservedEnvironment is non-null, then:
|
||||
if (reserved_environment.has_value()) {
|
||||
|
@ -71,7 +71,7 @@ void WindowEnvironmentSettingsObject::setup(AK::URL const& creation_url, Nonnull
|
|||
|
||||
// 7. Set realm's [[HostDefined]] field to settings object.
|
||||
// Non-Standard: We store the ESO next to the web intrinsics in a custom HostDefined object
|
||||
auto intrinsics = realm->heap().allocate<Bindings::Intrinsics>(*realm, *realm);
|
||||
auto intrinsics = realm->heap().allocate<Bindings::Intrinsics>(*realm, *realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
auto host_defined = make<Bindings::HostDefined>(settings_object, intrinsics);
|
||||
realm->set_host_defined(move(host_defined));
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ public:
|
|||
{
|
||||
auto* realm = execution_context->realm;
|
||||
VERIFY(realm);
|
||||
auto settings_object = realm->heap().allocate<WorkerEnvironmentSettingsObject>(*realm, move(execution_context));
|
||||
auto settings_object = realm->heap().allocate<WorkerEnvironmentSettingsObject>(*realm, move(execution_context)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
settings_object->target_browsing_context = nullptr;
|
||||
|
||||
auto intrinsics = realm->heap().allocate<Bindings::Intrinsics>(*realm, *realm);
|
||||
auto intrinsics = realm->heap().allocate<Bindings::Intrinsics>(*realm, *realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
auto host_defined = make<Bindings::HostDefined>(settings_object, intrinsics);
|
||||
realm->set_host_defined(move(host_defined));
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<Storage> Storage::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<Storage>(realm, realm);
|
||||
return realm.heap().allocate<Storage>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
Storage::Storage(JS::Realm& realm)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
SubmitEvent* SubmitEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<SubmitEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<SubmitEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
SubmitEvent* SubmitEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<TextMetrics> TextMetrics::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<TextMetrics>(realm, realm);
|
||||
return realm.heap().allocate<TextMetrics>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
TextMetrics::TextMetrics(JS::Realm& realm)
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
|
||||
JS::NonnullGCPtr<Window> Window::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<Window>(realm, realm);
|
||||
return realm.heap().allocate<Window>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
Window::Window(JS::Realm& realm)
|
||||
|
@ -115,14 +115,14 @@ Window::~Window() = default;
|
|||
HighResolutionTime::Performance& Window::performance()
|
||||
{
|
||||
if (!m_performance)
|
||||
m_performance = heap().allocate<HighResolutionTime::Performance>(realm(), *this);
|
||||
m_performance = heap().allocate<HighResolutionTime::Performance>(realm(), *this).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return *m_performance;
|
||||
}
|
||||
|
||||
CSS::Screen& Window::screen()
|
||||
{
|
||||
if (!m_screen)
|
||||
m_screen = heap().allocate<CSS::Screen>(realm(), *this);
|
||||
m_screen = heap().allocate<CSS::Screen>(realm(), *this).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return *m_screen;
|
||||
}
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ void Window::initialize_web_interfaces(Badge<WindowEnvironmentSettingsObject>)
|
|||
define_native_accessor(realm, "outerWidth", outer_width_getter, {}, attr);
|
||||
define_native_accessor(realm, "outerHeight", outer_height_getter, {}, attr);
|
||||
|
||||
define_direct_property("CSS", heap().allocate<Bindings::CSSNamespace>(realm, realm), 0);
|
||||
define_direct_property("CSS", heap().allocate<Bindings::CSSNamespace>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(), 0);
|
||||
|
||||
define_native_accessor(realm, "localStorage", local_storage_getter, {}, attr);
|
||||
define_native_accessor(realm, "sessionStorage", session_storage_getter, {}, attr);
|
||||
|
@ -1143,9 +1143,9 @@ void Window::initialize_web_interfaces(Badge<WindowEnvironmentSettingsObject>)
|
|||
// Legacy
|
||||
define_native_accessor(realm, "event", event_getter, event_setter, JS::Attribute::Enumerable);
|
||||
|
||||
m_location = heap().allocate<HTML::Location>(realm, realm);
|
||||
m_location = heap().allocate<HTML::Location>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_navigator = heap().allocate<HTML::Navigator>(realm, realm);
|
||||
m_navigator = heap().allocate<HTML::Navigator>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
define_direct_property("navigator", m_navigator, JS::Attribute::Enumerable | JS::Attribute::Configurable);
|
||||
define_direct_property("clientInformation", m_navigator, JS::Attribute::Enumerable | JS::Attribute::Configurable);
|
||||
|
||||
|
@ -1153,7 +1153,7 @@ void Window::initialize_web_interfaces(Badge<WindowEnvironmentSettingsObject>)
|
|||
define_native_accessor(realm, "location", location_getter, location_setter, JS::Attribute::Enumerable);
|
||||
|
||||
// WebAssembly "namespace"
|
||||
define_direct_property("WebAssembly", heap().allocate<Bindings::WebAssemblyObject>(realm, realm), JS::Attribute::Enumerable | JS::Attribute::Configurable);
|
||||
define_direct_property("WebAssembly", heap().allocate<Bindings::WebAssemblyObject>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(), JS::Attribute::Enumerable | JS::Attribute::Configurable);
|
||||
|
||||
// HTML::GlobalEventHandlers and HTML::WindowEventHandlers
|
||||
#define __ENUMERATE(attribute, event_name) \
|
||||
|
|
|
@ -77,7 +77,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Worker>> Worker::create(DeprecatedFlyString
|
|||
// 5. Let worker URL be the resulting URL record.
|
||||
|
||||
// 6. Let worker be a new Worker object.
|
||||
auto worker = document.heap().allocate<Worker>(document.realm(), script_url, options, document);
|
||||
auto worker = MUST_OR_THROW_OOM(document.heap().allocate<Worker>(document.realm(), script_url, options, document));
|
||||
|
||||
// 7. Let outside port be a new MessagePort in outside settings's Realm.
|
||||
auto outside_port = MessagePort::create(outside_settings.realm());
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Web::HTML {
|
|||
|
||||
JS::NonnullGCPtr<WorkerNavigator> WorkerNavigator::create(WorkerGlobalScope& global_scope)
|
||||
{
|
||||
return global_scope.heap().allocate<WorkerNavigator>(global_scope.realm(), global_scope);
|
||||
return global_scope.heap().allocate<WorkerNavigator>(global_scope.realm(), global_scope).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
WorkerNavigator::WorkerNavigator(WorkerGlobalScope& global_scope)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue