mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibIDL+LibWeb: Resolve distinguishing argument index at build time
Aside from the obvious performance benefits, this will allow us to properly handle dictionary types. (whose dictionary-ness is only known at build-time) Much of the rest of the overload resolution algorithm steps can (and should) be evaluated at build-time as well, but this is a good first step.
This commit is contained in:
committed by
Andreas Kling
parent
048e179572
commit
f837f02eea
@@ -56,6 +56,8 @@ static bool has_overload_with_argument_type_or_subtype_matching(IDL::EffectiveOv
|
||||
// https://webidl.spec.whatwg.org/#es-overloads
|
||||
JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM& vm, IDL::EffectiveOverloadSet& overloads)
|
||||
{
|
||||
// FIXME: The vast majority of this algorithm can be (and must be, in order to resolve the dictionary
|
||||
// related FIXMEs below) evaluated at code-generation time.
|
||||
// 1. Let maxarg be the length of the longest type list of the entries in S.
|
||||
// 2. Let n be the size of args.
|
||||
// 3. Initialize argcount to be min(maxarg, n).
|
||||
|
||||
Reference in New Issue
Block a user