mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb: Make DOMException take error message as a String
There was no need to use FlyString for error messages, and it just caused a bunch of churn since these strings typically only existed during the lifetime of the error.
This commit is contained in:
parent
5f9a36feac
commit
175f3febb8
Notes:
github-actions[bot]
2024-10-12 19:15:13 +00:00
Author: https://github.com/awesomekling
Commit: 175f3febb8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1743
Reviewed-by: https://github.com/ADKaster
89 changed files with 464 additions and 462 deletions
|
@ -88,7 +88,7 @@ WebIDL::ExceptionOr<void> HTMLOptionsCollection::set_value_of_indexed_property(u
|
|||
}
|
||||
|
||||
if (!unconverted_option.is_object() || !is<HTMLOptionElement>(unconverted_option.as_object())) {
|
||||
return WebIDL::TypeMismatchError::create(realm(), "The value provided is not an HTMLOptionElement"_fly_string);
|
||||
return WebIDL::TypeMismatchError::create(realm(), "The value provided is not an HTMLOptionElement"_string);
|
||||
}
|
||||
|
||||
auto& option = static_cast<HTMLOptionElement&>(unconverted_option.as_object());
|
||||
|
@ -133,11 +133,11 @@ WebIDL::ExceptionOr<void> HTMLOptionsCollection::add(HTMLOptionOrOptGroupElement
|
|||
|
||||
// 1. If element is an ancestor of the select element on which the HTMLOptionsCollection is rooted, then throw a "HierarchyRequestError" DOMException.
|
||||
if (resolved_element->is_ancestor_of(root()))
|
||||
return WebIDL::HierarchyRequestError::create(realm(), "The provided element is an ancestor of the root select element."_fly_string);
|
||||
return WebIDL::HierarchyRequestError::create(realm(), "The provided element is an ancestor of the root select element."_string);
|
||||
|
||||
// 2. If before is an element, but that element isn't a descendant of the select element on which the HTMLOptionsCollection is rooted, then throw a "NotFoundError" DOMException.
|
||||
if (before_element && !before_element->is_descendant_of(root()))
|
||||
return WebIDL::NotFoundError::create(realm(), "The 'before' element is not a descendant of the root select element."_fly_string);
|
||||
return WebIDL::NotFoundError::create(realm(), "The 'before' element is not a descendant of the root select element."_string);
|
||||
|
||||
// 3. If element and before are the same element, then return.
|
||||
if (before_element && (resolved_element.ptr() == before_element.ptr()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue