diff options
author | Linus Groh <mail@linusgroh.de> | 2021-10-13 21:09:45 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-14 00:41:41 +0100 |
commit | d40331ef69b983ba4c57efc95e59424e19453914 (patch) | |
tree | 2121dd06b474263a0ac3b3e1d617feafffc5e4f6 /Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h | |
parent | 50f87557926962d2c180f0f330b1202ab76a7dd5 (diff) | |
download | serenity-d40331ef69b983ba4c57efc95e59424e19453914.zip |
LibJS: Start implementing ShadowRealm
This commit adds the ShadowRealm object itself, its constructor, and
prototype (currently empty).
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h new file mode 100644 index 0000000000..d84581ea9c --- /dev/null +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021, Linus Groh <linusg@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <LibJS/Runtime/NativeFunction.h> + +namespace JS { + +class ShadowRealmConstructor final : public NativeFunction { + JS_OBJECT(ShadowRealmConstructor, NativeFunction); + +public: + explicit ShadowRealmConstructor(GlobalObject&); + virtual void initialize(GlobalObject&) override; + virtual ~ShadowRealmConstructor() override = default; + + virtual Value call() override; + virtual Value construct(FunctionObject& new_target) override; + +private: + virtual bool has_constructor() const override { return true; } +}; + +} |