src/Instrumenter.js
/* Returns object that includes instrumented code and list of inserted probes */
Returns object that includes instrumented code and list of inserted probes
Returns object that includes instrumented code and list of inserted probes
function instrument(code) {
        var ast = esprima.parse(code, {
            loc: true,
            tolerant: false
        });
        var instrumented;
        instrumented = _instrumentFunctionDeclarations(ast);
        instrumented = _instrumentFunctionExpressions(instrumented.ast);
        instrumented = _instrumentProbes(instrumented.ast);
        return {
            code: tracerSnippet + escodegen.generate(instrumented.ast),
            probes: instrumented.probes
        };
    }
function instrument ( code ) { var ast = esprima . parse ( code , { loc : true , tolerant : false } ) ; var instrumented ; instrumented = _instrumentFunctionDeclarations ( ast ) ; instrumented = _instrumentFunctionExpressions ( instrumented . ast ) ; instrumented = _instrumentProbes ( instrumented . ast ) ; return { code : tracerSnippet + escodegen . generate ( instrumented . ast ) , probes : instrumented . probes } ; }
Returns object that includes instrumented code and list of inserted probes
Returns object that includes instrumented code and list of inserted probes