Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (expr.object === "i64") {
return evaluation.value._value;
}
return evaluation.value.toString();
}
});
const res = module.exports[name.value](...argValues);
return res;
}
/**
* REPL
*/
const memory = new Memory({ initial: 100 });
const allocator = createAllocator(memory);
// Cache instanced modules
const instantiatedModules = [];
// function wrapInModule(node) {
// const name = "autogenerated";
// return t.module(name, [node]);
// }
function assert(cond, msg = "unknown") {
if (cond === false) {
error(new Error("assertion failure: " + msg));
onAssert();
}
function evaluate(customNode: ?Array): ?StackLocal {
let n = [node];
if (typeof customNode !== "undefined") {
n = customNode;
}
const memory = new Memory({ initial: 100 });
const allocator = createAllocator(memory);
const code = n;
// $FlowIgnore
code.push(t.instruction("end"));
return partialEvaluation.evaluate(allocator, code);
}
// It's only meant for testing
if (expr.object === "i64") {
return evaluation.value._value;
}
return evaluation.value.toString();
}
});
return module.exports[name.value](...argValues);
}
/**
* REPL
*/
const memory = new Memory({ initial: 100 });
const allocator = createAllocator(memory);
// Cache instanced modules
const instantiatedModules = [];
function wrapInModule(node) {
const name = "autogenerated";
return t.module(name, [node]);
}
function assert(cond, msg = "unknown") {
if (cond === false) {
error(new Error("assertion failure: " + msg));
onAssert();
return;