OverloadResolution.h 654 B

12345678910111213141516171819202122232425262728
  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/Vector.h>
  9. #include <LibIDL/Types.h>
  10. #include <LibJS/Runtime/VM.h>
  11. namespace Web::WebIDL {
  12. struct ResolvedOverload {
  13. // Corresponds to "the special value “missing”" in the overload resolution algorithm.
  14. struct Missing { };
  15. using Argument = Variant<JS::Value, Missing>;
  16. int callable_id;
  17. Vector<Argument> arguments;
  18. };
  19. // https://webidl.spec.whatwg.org/#es-overloads
  20. JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&);
  21. }