mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 05:32:59 +00:00
Everywhere: Remove sv
suffix from format string literals
This prevents the compile-time checks that would catch errors in the format invocation (which would usually lead to a runtime crash).
This commit is contained in:
parent
917537b449
commit
f070264800
Notes:
github-actions[bot]
2025-04-09 00:01:12 +00:00
Author: https://github.com/trflynn89
Commit: f070264800
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4286
28 changed files with 51 additions and 51 deletions
|
@ -124,7 +124,7 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
|||
|
||||
// 2. If name is not a valid custom element name, then throw a "SyntaxError" DOMException.
|
||||
if (!is_valid_custom_element_name(name))
|
||||
return JS::throw_completion(WebIDL::SyntaxError::create(realm, MUST(String::formatted("'{}' is not a valid custom element name"sv, name))));
|
||||
return JS::throw_completion(WebIDL::SyntaxError::create(realm, MUST(String::formatted("'{}' is not a valid custom element name", name))));
|
||||
|
||||
// 3. If this's custom element definition set contains an item with name name, then throw a "NotSupportedError" DOMException.
|
||||
auto existing_definition_with_name_iterator = m_custom_element_definitions.find_if([&name](auto const& definition) {
|
||||
|
@ -132,7 +132,7 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
|||
});
|
||||
|
||||
if (existing_definition_with_name_iterator != m_custom_element_definitions.end())
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, MUST(String::formatted("A custom element with name '{}' is already defined"sv, name))));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, MUST(String::formatted("A custom element with name '{}' is already defined", name))));
|
||||
|
||||
// 4. If this's custom element definition set contains an item with constructor constructor, then throw a "NotSupportedError" DOMException.
|
||||
auto existing_definition_with_constructor_iterator = m_custom_element_definitions.find_if([&constructor](auto const& definition) {
|
||||
|
@ -152,13 +152,13 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
|||
if (extends.has_value()) {
|
||||
// 1. If extends is a valid custom element name, then throw a "NotSupportedError" DOMException.
|
||||
if (is_valid_custom_element_name(extends.value()))
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, MUST(String::formatted("'{}' is a custom element name, only non-custom elements can be extended"sv, extends.value()))));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, MUST(String::formatted("'{}' is a custom element name, only non-custom elements can be extended", extends.value()))));
|
||||
|
||||
// 2. If the element interface for extends and the HTML namespace is HTMLUnknownElement
|
||||
// (e.g., if extends does not indicate an element definition in this specification),
|
||||
// then throw a "NotSupportedError" DOMException.
|
||||
if (DOM::is_unknown_html_element(extends.value()))
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, MUST(String::formatted("'{}' is an unknown HTML element"sv, extends.value()))));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, MUST(String::formatted("'{}' is an unknown HTML element", extends.value()))));
|
||||
|
||||
// 3. Set localName to extends.
|
||||
local_name = extends.value();
|
||||
|
@ -362,7 +362,7 @@ WebIDL::ExceptionOr<GC::Ref<WebIDL::Promise>> CustomElementRegistry::when_define
|
|||
|
||||
// 1. If name is not a valid custom element name, then return a promise rejected with a "SyntaxError" DOMException.
|
||||
if (!is_valid_custom_element_name(name))
|
||||
return WebIDL::create_rejected_promise(realm, WebIDL::SyntaxError::create(realm, MUST(String::formatted("'{}' is not a valid custom element name"sv, name))));
|
||||
return WebIDL::create_rejected_promise(realm, WebIDL::SyntaxError::create(realm, MUST(String::formatted("'{}' is not a valid custom element name", name))));
|
||||
|
||||
// 2. If this's custom element definition set contains an item with name name, then return a promise resolved with that item's constructor.
|
||||
auto existing_definition_iterator = m_custom_element_definitions.find_if([&name](GC::Root<CustomElementDefinition> const& definition) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue