mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb/WebAssembly: Implement Module::imports(module)
This commit is contained in:
parent
3a6b6a732e
commit
f984c1cc51
Notes:
github-actions[bot]
2025-04-22 14:45:11 +00:00
Author: https://github.com/alimpfard
Commit: f984c1cc51
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4423
Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 52 additions and 6 deletions
|
@ -10,19 +10,32 @@
|
|||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/Array.h>
|
||||
#include <LibWasm/Types.h>
|
||||
#include <LibWeb/Bindings/ExceptionOrUtils.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/WebAssembly/WebAssembly.h>
|
||||
|
||||
namespace Web::Bindings {
|
||||
enum class ImportExportKind : u8;
|
||||
}
|
||||
|
||||
namespace Web::WebAssembly {
|
||||
|
||||
// FIXME: This should really be generated by the IDL generator.
|
||||
struct ModuleImportDescriptor {
|
||||
String module;
|
||||
String name;
|
||||
Bindings::ImportExportKind kind;
|
||||
};
|
||||
|
||||
class Module : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(Module, Bindings::PlatformObject);
|
||||
GC_DECLARE_ALLOCATOR(Module);
|
||||
|
||||
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>);
|
||||
|
||||
NonnullRefPtr<Detail::CompiledWebAssemblyModule> compiled_module() const { return m_compiled_module; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue