1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

LibWeb: Start implementing the IDL Overload Resolution Algorithm :^)

There are a *lot* of FIXME's here. :yakoverflow:
This commit is contained in:
Sam Atkins 2022-09-08 17:25:53 +01:00 committed by Andreas Kling
parent 0d2d5ba02c
commit ebc29842c8
3 changed files with 460 additions and 1 deletions

View file

@ -0,0 +1,28 @@
/*
* 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&);
}