OverloadResolution.h 724 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Optional.h>
  8. #include <AK/Span.h>
  9. #include <AK/Vector.h>
  10. #include <LibIDL/Types.h>
  11. #include <LibJS/Runtime/VM.h>
  12. namespace Web::WebIDL {
  13. struct ResolvedOverload {
  14. // Corresponds to "the special value “missing”" in the overload resolution algorithm.
  15. struct Missing { };
  16. using Argument = Variant<JS::Value, Missing>;
  17. int callable_id;
  18. Vector<Argument> arguments;
  19. };
  20. // https://webidl.spec.whatwg.org/#es-overloads
  21. JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&, ReadonlySpan<StringView> interface_dictionaries);
  22. }