LibWeb/WebAssembly: Implement Module::exports(module)

This commit is contained in:
Ali Mohammad Pur 2025-04-22 11:00:50 +02:00 committed by Andrew Kaster
parent f984c1cc51
commit 95cc2bd810
Notes: github-actions[bot] 2025-04-22 14:45:04 +00:00
3 changed files with 36 additions and 1 deletions

View file

@ -29,6 +29,11 @@ struct ModuleImportDescriptor {
Bindings::ImportExportKind kind;
};
struct ModuleExportDescriptor {
String name;
Bindings::ImportExportKind kind;
};
class Module : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(Module, Bindings::PlatformObject);
GC_DECLARE_ALLOCATOR(Module);
@ -36,6 +41,7 @@ class Module : public Bindings::PlatformObject {
public:
static WebIDL::ExceptionOr<GC::Ref<Module>> construct_impl(JS::Realm&, GC::Root<WebIDL::BufferSource>& bytes);
static WebIDL::ExceptionOr<Vector<ModuleImportDescriptor>> imports(JS::VM&, GC::Ref<Module>);
static WebIDL::ExceptionOr<Vector<ModuleExportDescriptor>> exports(JS::VM&, GC::Ref<Module>);
NonnullRefPtr<Detail::CompiledWebAssemblyModule> compiled_module() const { return m_compiled_module; }