summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-06-12 05:28:30 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-12 10:44:28 +0100
commit39554f3787eae7e52094cab16a966e62f00dea22 (patch)
treee0b331375290b09230da1bf69e0fab913070956d /Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h
parent1a8ee5d8d74da5a261c5347662dc543cb283ad5a (diff)
downloadserenity-39554f3787eae7e52094cab16a966e62f00dea22.zip
LibJS: Add the WeakMap built-in object
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h28
1 files changed, 28 insertions, 0 deletions
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 <idan.horowitz@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibJS/Runtime/NativeFunction.h>
+
+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; }
+};
+
+}