ladybird/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.h
Shannon Booth 70599d3f8d LibWeb: Add support for dictionaries in overload resolution
By making use of the known set of supported dictionary names in that
overload set. Note that this list is typically very small (the max that
we have currently is 1).
2024-10-28 22:56:39 +01:00

29 lines
724 B
C++

/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <AK/Span.h>
#include <AK/Vector.h>
#include <LibIDL/Types.h>
#include <LibJS/Runtime/VM.h>
namespace Web::WebIDL {
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&, ReadonlySpan<StringView> interface_dictionaries);
}