From 39554f3787eae7e52094cab16a966e62f00dea22 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 12 Jun 2021 05:28:30 +0300 Subject: LibJS: Add the WeakMap built-in object --- .../Libraries/LibJS/Runtime/WeakMapConstructor.h | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h (limited to 'Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h') diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h new file mode 100644 index 0000000000..42d47eadad --- /dev/null +++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021, Idan Horowitz + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace JS { + +class WeakMapConstructor final : public NativeFunction { + JS_OBJECT(WeakMapConstructor, NativeFunction); + +public: + explicit WeakMapConstructor(GlobalObject&); + virtual void initialize(GlobalObject&) override; + virtual ~WeakMapConstructor() override; + + virtual Value call() override; + virtual Value construct(Function&) override; + +private: + virtual bool has_constructor() const override { return true; } +}; + +} -- cgit v1.2.3