mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-26 07:22:21 +00:00
19 lines
434 B
JavaScript
19 lines
434 B
JavaScript
|
const fs = require("fs");
|
||
|
const path = require("path");
|
||
|
|
||
|
const compiled = new WebAssembly.Module(
|
||
|
fs.readFileSync(path.resolve(__dirname, "..", "build", "optimized.wasm"))
|
||
|
);
|
||
|
|
||
|
const imports = {
|
||
|
env: {
|
||
|
abort: (filename, line, column) => {
|
||
|
throw Error("abort called at " + line + ":" + colum);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
Object.defineProperty(module, "exports", {
|
||
|
get: () => new WebAssembly.Instance(compiled, imports).exports
|
||
|
});
|