LibWeb: Move IDLOverloadResolution from Bindings/ to WebIDL/

This commit is contained in:
Linus Groh 2022-09-24 16:18:31 +01:00
parent 6480faacb6
commit 86f68eb3c3
Notes: sideshowbarker 2024-07-17 10:39:39 +09:00
4 changed files with 6 additions and 6 deletions

View file

@ -1928,7 +1928,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@function.name:snakecase@)
if (!effective_overload_set.has_value())
return vm.throw_completion<JS::TypeError>(JS::ErrorType::OverloadResolutionFailed);
auto chosen_overload = TRY(resolve_overload(vm, effective_overload_set.value()));
auto chosen_overload = TRY(WebIDL::resolve_overload(vm, effective_overload_set.value()));
switch (chosen_overload.callable_id) {
)~~~");
@ -2358,7 +2358,6 @@ void generate_prototype_implementation(IDL::Interface const& interface)
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Bindings/@prototype_class@.h>
#include <LibWeb/Bindings/ExceptionOrUtils.h>
#include <LibWeb/Bindings/IDLOverloadResolution.h>
#include <LibWeb/Bindings/LocationObject.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/Event.h>
@ -2368,6 +2367,7 @@ void generate_prototype_implementation(IDL::Interface const& interface)
#include <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/WebIDL/OverloadResolution.h>
#if __has_include(<LibWeb/Bindings/@prototype_base_class@.h>)
# include <LibWeb/Bindings/@prototype_base_class@.h>

View file

@ -3,7 +3,6 @@ include(libweb_generators)
set(SOURCES
Bindings/AudioConstructor.cpp
Bindings/CSSNamespace.cpp
Bindings/IDLOverloadResolution.cpp
Bindings/ImageConstructor.cpp
Bindings/LegacyPlatformObject.cpp
Bindings/LocationConstructor.cpp
@ -413,6 +412,7 @@ set(SOURCES
WebGL/WebGLRenderingContextBase.cpp
WebIDL/AbstractOperations.cpp
WebIDL/CallbackType.cpp
WebIDL/OverloadResolution.cpp
WebSockets/WebSocket.cpp
XHR/EventNames.cpp
XHR/ProgressEvent.cpp

View file

@ -9,10 +9,10 @@
#include <LibJS/Runtime/FunctionObject.h>
#include <LibJS/Runtime/TypedArray.h>
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Bindings/IDLOverloadResolution.h>
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/WebIDL/OverloadResolution.h>
namespace Web::Bindings {
namespace Web::WebIDL {
// https://webidl.spec.whatwg.org/#dfn-convert-ecmascript-to-idl-value
static JS::Value convert_ecmascript_type_to_idl_value(JS::Value value, IDL::Type const&)

View file

@ -11,7 +11,7 @@
#include <LibIDL/Types.h>
#include <LibJS/Runtime/VM.h>
namespace Web::Bindings {
namespace Web::WebIDL {
struct ResolvedOverload {
// Corresponds to "the special value “missing”" in the overload resolution algorithm.