mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +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
|
@ -14,7 +14,7 @@ namespace Web::CSS {
|
|||
|
||||
CSSFontFaceRule* CSSFontFaceRule::create(JS::Realm& realm, FontFace&& font_face)
|
||||
{
|
||||
return realm.heap().allocate<CSSFontFaceRule>(realm, realm, move(font_face));
|
||||
return realm.heap().allocate<CSSFontFaceRule>(realm, realm, move(font_face)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CSSFontFaceRule::CSSFontFaceRule(JS::Realm& realm, FontFace&& font_face)
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Web::CSS {
|
|||
CSSImportRule* CSSImportRule::create(AK::URL url, DOM::Document& document)
|
||||
{
|
||||
auto& realm = document.realm();
|
||||
return realm.heap().allocate<CSSImportRule>(realm, move(url), document);
|
||||
return realm.heap().allocate<CSSImportRule>(realm, move(url), document).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document)
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::CSS {
|
|||
|
||||
CSSMediaRule* CSSMediaRule::create(JS::Realm& realm, MediaList& media_queries, CSSRuleList& rules)
|
||||
{
|
||||
return realm.heap().allocate<CSSMediaRule>(realm, realm, media_queries, rules);
|
||||
return realm.heap().allocate<CSSMediaRule>(realm, realm, media_queries, rules).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CSSMediaRule::CSSMediaRule(JS::Realm& realm, MediaList& media, CSSRuleList& rules)
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Web::CSS {
|
|||
|
||||
CSSRuleList* CSSRuleList::create(JS::Realm& realm, JS::MarkedVector<CSSRule*> const& rules)
|
||||
{
|
||||
auto rule_list = realm.heap().allocate<CSSRuleList>(realm, realm);
|
||||
auto rule_list = realm.heap().allocate<CSSRuleList>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
for (auto* rule : rules)
|
||||
rule_list->m_rules.append(*rule);
|
||||
return rule_list;
|
||||
|
@ -32,7 +32,7 @@ CSSRuleList::CSSRuleList(JS::Realm& realm)
|
|||
|
||||
CSSRuleList* CSSRuleList::create_empty(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<CSSRuleList>(realm, realm);
|
||||
return realm.heap().allocate<CSSRuleList>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSRuleList::initialize(JS::Realm& realm)
|
||||
|
|
|
@ -21,7 +21,7 @@ CSSStyleDeclaration::CSSStyleDeclaration(JS::Realm& realm)
|
|||
|
||||
PropertyOwningCSSStyleDeclaration* PropertyOwningCSSStyleDeclaration::create(JS::Realm& realm, Vector<StyleProperty> properties, HashMap<DeprecatedString, StyleProperty> custom_properties)
|
||||
{
|
||||
return realm.heap().allocate<PropertyOwningCSSStyleDeclaration>(realm, realm, move(properties), move(custom_properties));
|
||||
return realm.heap().allocate<PropertyOwningCSSStyleDeclaration>(realm, realm, move(properties), move(custom_properties)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PropertyOwningCSSStyleDeclaration::PropertyOwningCSSStyleDeclaration(JS::Realm& realm, Vector<StyleProperty> properties, HashMap<DeprecatedString, StyleProperty> custom_properties)
|
||||
|
@ -41,7 +41,7 @@ DeprecatedString PropertyOwningCSSStyleDeclaration::item(size_t index) const
|
|||
ElementInlineCSSStyleDeclaration* ElementInlineCSSStyleDeclaration::create(DOM::Element& element, Vector<StyleProperty> properties, HashMap<DeprecatedString, StyleProperty> custom_properties)
|
||||
{
|
||||
auto& realm = element.realm();
|
||||
return realm.heap().allocate<ElementInlineCSSStyleDeclaration>(realm, element, move(properties), move(custom_properties));
|
||||
return realm.heap().allocate<ElementInlineCSSStyleDeclaration>(realm, element, move(properties), move(custom_properties)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
ElementInlineCSSStyleDeclaration::ElementInlineCSSStyleDeclaration(DOM::Element& element, Vector<StyleProperty> properties, HashMap<DeprecatedString, StyleProperty> custom_properties)
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Web::CSS {
|
|||
|
||||
CSSStyleRule* CSSStyleRule::create(JS::Realm& realm, NonnullRefPtrVector<Web::CSS::Selector>&& selectors, CSSStyleDeclaration& declaration)
|
||||
{
|
||||
return realm.heap().allocate<CSSStyleRule>(realm, realm, move(selectors), declaration);
|
||||
return realm.heap().allocate<CSSStyleRule>(realm, realm, move(selectors), declaration).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CSSStyleRule::CSSStyleRule(JS::Realm& realm, NonnullRefPtrVector<Selector>&& selectors, CSSStyleDeclaration& declaration)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Web::CSS {
|
|||
|
||||
CSSStyleSheet* CSSStyleSheet::create(JS::Realm& realm, CSSRuleList& rules, MediaList& media, Optional<AK::URL> location)
|
||||
{
|
||||
return realm.heap().allocate<CSSStyleSheet>(realm, realm, rules, media, move(location));
|
||||
return realm.heap().allocate<CSSStyleSheet>(realm, realm, rules, media, move(location)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& media, Optional<AK::URL> location)
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Web::CSS {
|
|||
|
||||
CSSSupportsRule* CSSSupportsRule::create(JS::Realm& realm, NonnullRefPtr<Supports>&& supports, CSSRuleList& rules)
|
||||
{
|
||||
return realm.heap().allocate<CSSSupportsRule>(realm, realm, move(supports), rules);
|
||||
return realm.heap().allocate<CSSSupportsRule>(realm, realm, move(supports), rules).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
CSSSupportsRule::CSSSupportsRule(JS::Realm& realm, NonnullRefPtr<Supports>&& supports, CSSRuleList& rules)
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::CSS {
|
|||
|
||||
MediaList* MediaList::create(JS::Realm& realm, NonnullRefPtrVector<MediaQuery>&& media)
|
||||
{
|
||||
return realm.heap().allocate<MediaList>(realm, realm, move(media));
|
||||
return realm.heap().allocate<MediaList>(realm, realm, move(media)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
MediaList::MediaList(JS::Realm& realm, NonnullRefPtrVector<MediaQuery>&& media)
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Web::CSS {
|
|||
|
||||
JS::NonnullGCPtr<MediaQueryList> MediaQueryList::create(DOM::Document& document, NonnullRefPtrVector<MediaQuery>&& media)
|
||||
{
|
||||
return document.heap().allocate<MediaQueryList>(document.realm(), document, move(media));
|
||||
return document.heap().allocate<MediaQueryList>(document.realm(), document, move(media)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector<MediaQuery>&& media)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::CSS {
|
|||
|
||||
MediaQueryListEvent* MediaQueryListEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<MediaQueryListEvent>(realm, realm, event_name, event_init);
|
||||
return realm.heap().allocate<MediaQueryListEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init)
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Web::CSS {
|
|||
|
||||
ResolvedCSSStyleDeclaration* ResolvedCSSStyleDeclaration::create(DOM::Element& element)
|
||||
{
|
||||
return element.realm().heap().allocate<ResolvedCSSStyleDeclaration>(element.realm(), element);
|
||||
return element.realm().heap().allocate<ResolvedCSSStyleDeclaration>(element.realm(), element).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
ResolvedCSSStyleDeclaration::ResolvedCSSStyleDeclaration(DOM::Element& element)
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::CSS {
|
|||
|
||||
JS::NonnullGCPtr<Screen> Screen::create(HTML::Window& window)
|
||||
{
|
||||
return window.heap().allocate<Screen>(window.realm(), window);
|
||||
return window.heap().allocate<Screen>(window.realm(), window).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
Screen::Screen(HTML::Window& window)
|
||||
|
|
|
@ -48,7 +48,7 @@ void StyleSheetList::remove_sheet(CSSStyleSheet& sheet)
|
|||
StyleSheetList* StyleSheetList::create(DOM::Document& document)
|
||||
{
|
||||
auto& realm = document.realm();
|
||||
return realm.heap().allocate<StyleSheetList>(realm, document);
|
||||
return realm.heap().allocate<StyleSheetList>(realm, document).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
StyleSheetList::StyleSheetList(DOM::Document& document)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue