feat: add a histrical wit-bindgen

This commit is contained in:
2023-01-01 00:25:48 +08:00
parent 01e8f5a959
commit aa50d63aec
419 changed files with 45283 additions and 1 deletions

View File

@@ -0,0 +1 @@
nop: func()

View File

@@ -0,0 +1,20 @@
import { Exports } from "./exports.js";
import { getWasm } from "./helpers.js";
async function run() {
const importObj = {};
const wasm = new Exports();
await wasm.instantiate(getWasm(), importObj);
// test other methods of creating a wasm wrapper
(new Exports()).instantiate(getWasm().buffer, importObj);
(new Exports()).instantiate(new Uint8Array(getWasm()), importObj);
(new Exports()).instantiate(new WebAssembly.Module(getWasm()), importObj);
{
const obj = new Exports();
obj.addToImports(importObj);
obj.instantiate(new WebAssembly.Instance(new WebAssembly.Module(getWasm()), importObj));
}
}
await run()

View File

@@ -0,0 +1,3 @@
#include <exports.h>
void exports_nop() {}