Package Exports
- linvail
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (linvail) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Linvail
Linvail is npm module that implements a control access system around JavaScript code instrumented by Aran. Linvail's motivation is to build dynamic analyses capable of tracking primitive values across the object graph.
const Aran = require("aran");
const Acorn = require("acorn");
const Astring = require("astring");
const Linvail = require("linvail");
const print = (value) => {
if (value && typeof value === "object")
return "#object";
if (typeof value === "function")
return "#function";
if (typeof value === "string")
return JSON.stringify(value);
return String(value);
}
const aran = Aran({namespace:"META", sandbox:true}); // Sandboxing must be enabled!
const instrument = (script, parent) =>
Astring.generate(aran.weave(Acorn.parse(script), pointcut, parent));
let counter = 0;
const linvail = Linvail(instrument, {
enter: (value) => (console.log("@"+(++counter)+" = "+print(value)), {base:value,meta:counter}),
leave: (value) => (console.log("using @"+value.meta), value.base)
});
const pointcut = Object.keys(linvail.traps);
const META = linvail.traps;
let sandbox = linvail.sandbox; // aran's setup must have access to the linvail's sandbox
eval(Astring.generate(aran.setup(pointcut)));
eval(instrument([
"const o = {foo:null};", // log: @22 = null
"console.log(JSON.stringify(o));", // log: {"foo":null}
"o.foo;" // log: using @22
].join("\n"), null));
- demo/analysis/identity: Demonstrate the API of linvail but don't produce observable effects.
- demo/analysis/wrapper: Every values entering instrumented areas are wrapped to provide a well-defined identity. Every wrapper leaving instrumented areas are unwrapped to avoid heisenbugs. Wrapping and unwrapping operations are logged.
- demo/analysis/concolic: Same as above but also logs the arguments and result of triggered aran's traps. The resulting log is a detailed data-flow trace which can be fed to a SMT solver after formatting.
Acknowledgments
I'm Laurent Christophe a phd student at the Vrij Universiteit of Brussel (VUB). I'm working at the SOFT language lab in close relation with my promoters Coen De Roover and Wolfgang De Meuter. I'm currently being employed on the Tearless project.