2021-07-01 13:44:05 +03:00
|
|
|
/*
|
|
|
|
* 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:
|
2022-08-16 02:20:49 +03:00
|
|
|
explicit WebAssemblyModuleConstructor(JS::Realm&);
|
2022-08-16 02:20:49 +03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2021-07-01 13:44:05 +03:00
|
|
|
virtual ~WebAssemblyModuleConstructor() override;
|
|
|
|
|
2021-10-20 23:16:30 +03:00
|
|
|
virtual JS::ThrowCompletionOr<JS::Value> call() override;
|
|
|
|
virtual JS::ThrowCompletionOr<JS::Object*> construct(JS::FunctionObject& new_target) override;
|
2021-07-01 13:44:05 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|