mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
|
@ -214,7 +214,7 @@ WebIDL::ExceptionOr<JS::GCPtr<Attr>> NamedNodeMap::set_attribute(Attr& attribute
|
|||
{
|
||||
// 1. If attr’s element is neither null nor element, throw an "InUseAttributeError" DOMException.
|
||||
if ((attribute.owner_element() != nullptr) && (attribute.owner_element() != &associated_element()))
|
||||
return WebIDL::InUseAttributeError::create(realm(), "Attribute must not already be in use"_fly_string);
|
||||
return WebIDL::InUseAttributeError::create(realm(), "Attribute must not already be in use"_string);
|
||||
|
||||
// 2. Let oldAttr be the result of getting an attribute given attr’s namespace, attr’s local name, and element.
|
||||
size_t old_attribute_index = 0;
|
||||
|
@ -342,7 +342,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Attr>> NamedNodeMap::remove_attribute_node(
|
|||
// 1. If this’s attribute list does not contain attr, then throw a "NotFoundError" DOMException.
|
||||
auto index = m_attributes.find_first_index(attr);
|
||||
if (!index.has_value())
|
||||
return WebIDL::NotFoundError::create(realm(), "Attribute not found"_fly_string);
|
||||
return WebIDL::NotFoundError::create(realm(), "Attribute not found"_string);
|
||||
|
||||
// 2. Remove attr.
|
||||
remove_attribute_at_index(index.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue