1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

LibJS: Add DisposableStack{, Prototype, Constructor}

Since the async parts of the spec are not stage 3 at this point we don't
add AsyncDisposableStack.
This commit is contained in:
davidot 2022-12-21 11:48:14 +01:00 committed by Linus Groh
parent bff038411a
commit 6255ca4a42
22 changed files with 868 additions and 0 deletions

View file

@ -0,0 +1,29 @@
/*
* 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; }
};
}