summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-01 15:14:05 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-02 04:53:01 +0430
commit321db0159e8d004ef963bb4aa6b23990df1cc304 (patch)
tree3eca5245f15ac246e393c72f237da88019c3807c /Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h
parent8acc8339d19aa76f839d21190d908a43a081d93a (diff)
downloadserenity-321db0159e8d004ef963bb4aa6b23990df1cc304.zip
LibWeb: Add the WebAssembly.Module constructor
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h')
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h
new file mode 100644
index 0000000000..9df31c2a2a
--- /dev/null
+++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibJS/Runtime/NativeFunction.h>
+
+namespace Web::Bindings {
+
+class WebAssemblyModuleConstructor : public JS::NativeFunction {
+ JS_OBJECT(WebAssemblyModuleConstructor, JS::NativeFunction);
+
+public:
+ explicit WebAssemblyModuleConstructor(JS::GlobalObject&);
+ virtual void initialize(JS::GlobalObject&) override;
+ virtual ~WebAssemblyModuleConstructor() override;
+
+ virtual JS::Value call() override;
+ virtual JS::Value construct(JS::FunctionObject& new_target) override;
+
+private:
+ virtual bool has_constructor() const override { return true; }
+};
+
+}