@ -1,5 +1,7 @@
const injector = {};
// These functions are used to actually inject the instrumentation events.
injector.callEvent = function injectCallEvent(contract, fileName, injectionPoint) {
const linecount = (contract.instrumented.slice(0, injectionPoint).match(/\n/g) || []).length + 1;
contract.runnableLines.push(linecount);
@ -1,5 +1,8 @@
const instrumenter = {};
// These functions work out where in an expression we can inject our
// instrumenation events.
function createOrAppendInjectionPoint(contract, key, value) {
if (contract.injectionPoints[key]) {
contract.injectionPoints[key].push(value);
@ -1,6 +1,9 @@
const parse = {};
const instrumenter = require('./instrumenter');
// All the functions in this file do is walk the AST and call the instrumenter
// functions where appropriate, which determine where to inject events.
// Assign a dummy function to everything we might see in the AST
['AssignmentExpression',
'BinaryExpression',