1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-20 23:22:08 +00:00
serenity/Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.h
Sam Atkins ebc29842c8 LibWeb: Start implementing the IDL Overload Resolution Algorithm :^)
There are a *lot* of FIXME's here. :yakoverflow:
2022-09-17 21:27:17 +02:00

28 lines
656 B
C++

/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <AK/Vector.h>
#include <LibIDL/Types.h>
#include <LibJS/Runtime/VM.h>
namespace Web::Bindings {
struct ResolvedOverload {
// Corresponds to "the special value “missing”" in the overload resolution algorithm.
struct Missing { };
using Argument = Variant<JS::Value, Missing>;
int callable_id;
Vector<Argument> arguments;
};
// https://webidl.spec.whatwg.org/#es-overloads
JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&);
}