1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 01:44:58 +00:00
serenity/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h
davidot 6255ca4a42 LibJS: Add DisposableStack{, Prototype, Constructor}
Since the async parts of the spec are not stage 3 at this point we don't
add AsyncDisposableStack.
2023-01-23 09:56:50 +00:00

29 lines
702 B
C++

/*
* 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);
public:
virtual void initialize(Realm&) override;
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; }
};
}