MCPcopy Create free account
hub / github.com/callstackincubator/polygen / constructor

Method constructor

packages/polygen/src/api/Module.ts:17–32  ·  view source on GitHub ↗
(buffer: ArrayBuffer)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 2

isFakeModuleFunction · 0.85
loadModuleMethod · 0.65

Tested by

no test coverage detected