src/third_party/mozjs/extract/js/src/devtools/rootAnalysis/analyzeRoots.js
// given function and store it.
given function and store it.
given function and store it .
function loadPrintedLines(functionName)
{
    assert(!os.system("xdbfind src_body.xdb '" + functionName + "' > " + tmpfile));
    var lines = snarf(tmpfile).split('\n');
    for (var body of functionBodies)
        body.lines = [];
    var currentBody = null;
    for (var line of lines) {
        if (/^block:/.test(line)) {
            if (match = /:(loop#[\d#]+)/.exec(line)) {
                var loop = match[1];
                var found = false;
                for (var body of functionBodies) {
                    if (body.BlockId.Kind == "Loop" && body.BlockId.Loop == loop) {
                        assert(!found);
                        found = true;
                        currentBody = body;
                    }
                }
                assert(found);
            } else {
                for (var body of functionBodies) {
                    if (body.BlockId.Kind == "Function")
                        currentBody = body;
                }
            }
        }
        if (currentBody)
            currentBody.lines.push(line);
    }
}
function loadPrintedLines ( functionName ) { assert ( ! os . system ( "xdbfind src_body.xdb '" + functionName + "' > " + tmpfile ) ) ; var lines = snarf ( tmpfile ) . split ( '\n' ) ; for ( var body of functionBodies ) body . lines = [ ] ; var currentBody = null ; for ( var line of lines ) { if ( / ^block: / . test ( line ) ) { if ( match = / :(loop#[\d#]+) / . exec ( line ) ) { var loop = match [ 1 ] ; var found = false ; for ( var body of functionBodies ) { if ( body . BlockId . Kind == "Loop" && body . BlockId . Loop == loop ) { assert ( ! found ) ; found = true ; currentBody = body ; } } assert ( found ) ; } else { for ( var body of functionBodies ) { if ( body . BlockId . Kind == "Function" ) currentBody = body ; } } } if ( currentBody ) currentBody . lines . push ( line ) ; } }
given function and store it.
given function and store it .
// Distribute lines of output to the block they originate from.