Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
require("sucrase/register");
const fs = require("fs");
const {loadProjectFiles} = require("../benchmark/loadProjectFiles");
const {parse} = require("../src/parser");
let wasmModule;
try {
wasmModule = new WebAssembly.Module(fs.readFileSync(__dirname + "/build/optimized.wasm"));
} catch (e) {
console.error(e);
throw e;
}
const {instantiate} = require("@assemblyscript/loader");
const instance = instantiate(wasmModule, {
env: {
abort: () => {
throw new Error();
},
trace: (s, n) => {
try {
console.log(instance.getString(s), n);
} catch {
console.log(n);
}
},
},
});
async function run() {
const files = await loadProjectFiles("./src");