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