2021-06-11 17:06:20 +00:00
|
|
|
/*
|
2022-12-14 19:18:10 +00:00
|
|
|
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
2021-06-11 17:06:20 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class AggregateErrorConstructor final : public NativeFunction {
|
|
|
|
JS_OBJECT(AggregateErrorConstructor, NativeFunction);
|
2023-11-19 08:45:05 +00:00
|
|
|
JS_DECLARE_ALLOCATOR(AggregateErrorConstructor);
|
2021-06-11 17:06:20 +00:00
|
|
|
|
|
|
|
public:
|
2023-08-07 06:41:28 +00:00
|
|
|
virtual void initialize(Realm&) override;
|
2021-06-11 17:06:20 +00:00
|
|
|
virtual ~AggregateErrorConstructor() override = default;
|
|
|
|
|
2021-10-20 20:16:30 +00:00
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2022-12-14 19:18:10 +00:00
|
|
|
virtual ThrowCompletionOr<NonnullGCPtr<Object>> construct(FunctionObject& new_target) override;
|
2021-06-11 17:06:20 +00:00
|
|
|
|
|
|
|
private:
|
2022-08-28 21:51:28 +00:00
|
|
|
explicit AggregateErrorConstructor(Realm&);
|
2021-06-11 17:06:20 +00:00
|
|
|
virtual bool has_constructor() const override { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|