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:
parent
0d2d5ba02c
commit
ebc29842c8
3 changed files with 460 additions and 1 deletions
28
Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.h
Normal file
28
Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.h
Normal 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&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue