(buffer: ArrayBuffer)
| 15 | metadata: InternalModuleMetadata; |
| 16 | |
| 17 | public constructor(buffer: ArrayBuffer) { |
| 18 | try { |
| 19 | this.metadata = NativeWASM.loadModule(this, buffer); |
| 20 | } catch (e) { |
| 21 | throw new CompileError((e as Error).message); |
| 22 | } |
| 23 | |
| 24 | if (!isFakeModule(buffer)) { |
| 25 | // TODO: add documentation link |
| 26 | console.warn( |
| 27 | '[polygen] Loaded a WebAssembly module from ArrayBuffer, use a loader plugin instead. ' + |
| 28 | 'This method is meant only for development purposes, ' + |
| 29 | 'and should not be used in production.' |
| 30 | ); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | public static imports(mod: Module): ModuleImportDescriptor[] { |
| 35 | return mod.metadata.imports; |
nothing calls this directly
no test coverage detected