mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-14 19:06:55 +02: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. (cherry picked from commit 175f3febb8037a440d4ead7347d3266ee3d345e1; minorly amended to fix conflict in WebSocket.cpp due to serenity not having the adapter class removal in LadybirdBrowser/ladybird#1671)
This commit is contained in:
committed by
Nico Weber
parent
a73fb690aa
commit
9b4db4a0e0
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user