mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 15:12:12 +00:00
The `unchecked` builtin should be handled with ultimate care and it would be a lot better if there'd be a mechanism doing this automatically.
9 lines
363 B
JavaScript
9 lines
363 B
JavaScript
const fs = require("fs");
|
|
const compiled = new WebAssembly.Module(fs.readFileSync(__dirname + "/build/optimized.wasm"));
|
|
const imports = {
|
|
env: { abort: function(filename, line, column) { throw Error("abort called at " + line + ":" + colum); } }
|
|
};
|
|
Object.defineProperty(module, "exports", {
|
|
get: () => new WebAssembly.Instance(compiled, imports).exports
|
|
});
|