WebAssemblyInstanceConstructor.h 765 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/NativeFunction.h>
  8. namespace Web::Bindings {
  9. class WebAssemblyInstanceConstructor : public JS::NativeFunction {
  10. JS_OBJECT(WebAssemblyInstanceConstructor, JS::NativeFunction);
  11. public:
  12. explicit WebAssemblyInstanceConstructor(JS::GlobalObject&);
  13. virtual void initialize(JS::GlobalObject&) override;
  14. virtual ~WebAssemblyInstanceConstructor() override;
  15. virtual JS::ThrowCompletionOr<JS::Value> call() override;
  16. virtual JS::ThrowCompletionOr<JS::Object*> construct(JS::FunctionObject& new_target) override;
  17. private:
  18. virtual bool has_constructor() const override { return true; }
  19. };
  20. }