2018-05-03 03:12:03 +03:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
const compiled = new WebAssembly.Module(
|
|
|
|
fs.readFileSync(path.resolve(__dirname, "..", "build", "optimized.wasm"))
|
|
|
|
);
|
|
|
|
|
|
|
|
const imports = {
|
|
|
|
env: {
|
2018-07-21 15:11:39 +03:00
|
|
|
memory: new WebAssembly.Memory({ initial: 10 }),
|
2018-05-03 03:12:03 +03:00
|
|
|
abort: (filename, line, column) => {
|
2019-06-05 23:15:39 +02:00
|
|
|
throw Error("abort called at " + line + ":" + column);
|
2018-05-03 03:12:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.defineProperty(module, "exports", {
|
|
|
|
get: () => new WebAssembly.Instance(compiled, imports).exports
|
|
|
|
});
|