AggregateErrorConstructor.h 760 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/NativeFunction.h>
  8. namespace JS {
  9. class AggregateErrorConstructor final : public NativeFunction {
  10. JS_OBJECT(AggregateErrorConstructor, NativeFunction);
  11. GC_DECLARE_ALLOCATOR(AggregateErrorConstructor);
  12. public:
  13. virtual void initialize(Realm&) override;
  14. virtual ~AggregateErrorConstructor() override = default;
  15. virtual ThrowCompletionOr<Value> call() override;
  16. virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
  17. private:
  18. explicit AggregateErrorConstructor(Realm&);
  19. virtual bool has_constructor() const override { return true; }
  20. };
  21. }