From a7b8828db29dba6f2ec6a75d48925c185afcfd66 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Wed, 22 Nov 2023 20:00:14 +1300 Subject: [PATCH] LibWeb: Port call_user_object_operation from DeprecatedString --- Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp | 2 +- Userland/Libraries/LibWeb/DOM/NodeIterator.cpp | 2 +- Userland/Libraries/LibWeb/DOM/TreeWalker.cpp | 2 +- Userland/Libraries/LibWeb/WebIDL/AbstractOperations.cpp | 4 ++-- Userland/Libraries/LibWeb/WebIDL/AbstractOperations.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp b/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp index 8236f2ce67..72b05dc8e4 100644 --- a/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp @@ -113,7 +113,7 @@ bool EventDispatcher::inner_invoke(Event& event, Vector NodeIterator::filter(Node& node) // 6. Let result be the return value of call a user object’s operation with traverser’s filter, "acceptNode", and « node ». // If this throws an exception, then unset traverser’s active flag and rethrow the exception. - auto result = WebIDL::call_user_object_operation(m_filter->callback(), "acceptNode", {}, &node); + auto result = WebIDL::call_user_object_operation(m_filter->callback(), "acceptNode"_string, {}, &node); if (result.is_abrupt()) { m_active = false; return result; diff --git a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp index ef87a0cc4e..87ab5771e3 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp @@ -257,7 +257,7 @@ JS::ThrowCompletionOr TreeWalker::filter(Node& node) // 6. Let result be the return value of call a user object’s operation with traverser’s filter, "acceptNode", and « node ». // If this throws an exception, then unset traverser’s active flag and rethrow the exception. - auto result = WebIDL::call_user_object_operation(m_filter->callback(), "acceptNode", {}, &node); + auto result = WebIDL::call_user_object_operation(m_filter->callback(), "acceptNode"_string, {}, &node); if (result.is_abrupt()) { m_active = false; return result; diff --git a/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.cpp b/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.cpp index aba077dde6..6ff3360c2d 100644 --- a/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.cpp @@ -114,7 +114,7 @@ inline JS::Completion clean_up_on_return(HTML::EnvironmentSettingsObject& stored return JS::Value { rejected_promise->promise() }; } -JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, DeprecatedString const& operation_name, Optional this_argument, JS::MarkedVector args) +JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, String const& operation_name, Optional this_argument, JS::MarkedVector args) { // 1. Let completion be an uninitialized variable. JS::Completion completion; @@ -147,7 +147,7 @@ JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, Deprec // 10. If ! IsCallable(O) is false, then: if (!object->is_function()) { // 1. Let getResult be Get(O, opName). - auto get_result = object->get(operation_name); + auto get_result = object->get(operation_name.to_deprecated_string()); // 2. If getResult is an abrupt completion, set completion to getResult and jump to the step labeled return. if (get_result.is_throw_completion()) { diff --git a/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.h b/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.h index be19603e49..650eeedd76 100644 --- a/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.h +++ b/Userland/Libraries/LibWeb/WebIDL/AbstractOperations.h @@ -19,11 +19,11 @@ namespace Web::WebIDL { ErrorOr get_buffer_source_copy(JS::Object const& buffer_source); -JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, DeprecatedString const& operation_name, Optional this_argument, JS::MarkedVector args); +JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, String const& operation_name, Optional this_argument, JS::MarkedVector args); // https://webidl.spec.whatwg.org/#call-a-user-objects-operation template -JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, DeprecatedString const& operation_name, Optional this_argument, Args&&... args) +JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, String const& operation_name, Optional this_argument, Args&&... args) { auto& function_object = callback.callback;