mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 15:40:28 +00:00
LibJS+LibWeb: Port interned bytecode strings to UTF-16
This was almost a no-op, except we intern JS exception messages. So the bulk of this patch is porting exception messages to UTF-16.
This commit is contained in:
parent
cf61171864
commit
70db474cf0
Notes:
github-actions[bot]
2025-08-14 08:28:16 +00:00
Author: https://github.com/trflynn89
Commit: 70db474cf0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5845
Reviewed-by: https://github.com/gmta ✅
162 changed files with 1405 additions and 1422 deletions
|
@ -114,7 +114,7 @@ WebIDL::ExceptionOr<Attr const*> NamedNodeMap::remove_named_item(FlyString const
|
|||
|
||||
// 2. If attr is null, then throw a "NotFoundError" DOMException.
|
||||
if (!attribute)
|
||||
return WebIDL::NotFoundError::create(realm(), MUST(String::formatted("Attribute with name '{}' not found", qualified_name)));
|
||||
return WebIDL::NotFoundError::create(realm(), Utf16String::formatted("Attribute with name '{}' not found", qualified_name));
|
||||
|
||||
// 3. Return attr.
|
||||
return attribute;
|
||||
|
@ -128,7 +128,7 @@ WebIDL::ExceptionOr<Attr const*> NamedNodeMap::remove_named_item_ns(Optional<Fly
|
|||
|
||||
// 2. If attr is null, then throw a "NotFoundError" DOMException.
|
||||
if (!attribute)
|
||||
return WebIDL::NotFoundError::create(realm(), MUST(String::formatted("Attribute with namespace '{}' and local name '{}' not found", namespace_, local_name)));
|
||||
return WebIDL::NotFoundError::create(realm(), Utf16String::formatted("Attribute with namespace '{}' and local name '{}' not found", namespace_, local_name));
|
||||
|
||||
// 3. Return attr.
|
||||
return attribute;
|
||||
|
@ -199,7 +199,7 @@ WebIDL::ExceptionOr<GC::Ptr<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"_string);
|
||||
return WebIDL::InUseAttributeError::create(realm(), "Attribute must not already be in use"_utf16);
|
||||
|
||||
// 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;
|
||||
|
@ -336,7 +336,7 @@ WebIDL::ExceptionOr<GC::Ref<Attr>> NamedNodeMap::remove_attribute_node(GC::Ref<A
|
|||
// 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"_string);
|
||||
return WebIDL::NotFoundError::create(realm(), "Attribute not found"_utf16);
|
||||
|
||||
// 2. Remove attr.
|
||||
remove_attribute_at_index(index.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue