bin/diff.js
function runTool(platform, args, done) {
  var inputFile1 = args[0];
  var inputFile2 = args[1];
  var filterString = args[2];
  if (!inputFile1 || !inputFile2) {
    console.log('usage: diff.js file1.wtf-trace file2.wtf-trace [filter]');
    done(1);
    return;
  }
  console.log('Diffing ' + inputFile1 + ' and ' + inputFile2 + '...');
  console.log('');

  var filter = null;
  if (filterString) {
    filter = new wtf.db.Filter(filterString);
  }

  // Create databases for querying.
  var db1 = null;
  var db2 = null;
  wtf.db.load(inputFile1, function(db) {
    if (db instanceof Error) {
      console.log('ERROR: unable to open ' + inputFile1, db);
      done(1);
      return;
    }

    db1 = db;
    if (db1 && db2) {
      diffDatabases(db1, db2, filter);
      done(0);
    }
  });
  wtf.db.load(inputFile2, function(db) {
    if (db instanceof Error) {
      console.log('ERROR: unable to open ' + inputFile2, db);
      done(1);
      return;
    }

    db2 = db;
    if (db1 && db2) {
      diffDatabases(db1, db2, filter);
      done(0);
    }
  });
}
function runTool(platform, args, done) {
  var inputFile1 = args[0];
  var inputFile2 = args[1];
  var filterString = args[2];
  if (!inputFile1 || !inputFile2) {
    console.log('usage: diff.js file1.wtf-trace file2.wtf-trace [filter]');
    done(1);
    return;
  }
  console.log('Diffing ' + inputFile1 + ' and ' + inputFile2 + '...');
  console.log('');

  var filter = null;
  if (filterString) {
    filter = new wtf.db.Filter(filterString);
  }

  // Create databases for querying.
  var db1 = null;
  var db2 = null;
  wtf.db.load(inputFile1, function(db) {
    if (db instanceof Error) {
      console.log('ERROR: unable to open ' + inputFile1, db);
      done(1);
      return;
    }

    db1 = db;
    if (db1 && db2) {
      diffDatabases(db1, db2, filter);
      done(0);
    }
  });
  wtf.db.load(inputFile2, function(db) {
    if (db instanceof Error) {
      console.log('ERROR: unable to open ' + inputFile2, db);
      done(1);
      return;
    }

    db2 = db;
    if (db1 && db2) {
      diffDatabases(db1, db2, filter);
      done(0);
    }
  });
}
function runTool ( platform , args , done ) { var inputFile1 = args [ 0 ] ; var inputFile2 = args [ 1 ] ; var filterString = args [ 2 ] ; if ( ! inputFile1 || ! inputFile2 ) { console . log ( 'usage: diff.js file1.wtf-trace file2.wtf-trace [filter]' ) ; done ( 1 ) ; return ; } console . log ( 'Diffing ' + inputFile1 + ' and ' + inputFile2 + '...' ) ; console . log ( '' ) ; var filter = null ; if ( filterString ) { filter = new wtf . db . Filter ( filterString ) ; } // Create databases for querying. var db1 = null ; var db2 = null ; wtf . db . load ( inputFile1 , function ( db ) { if ( db instanceof Error ) { console . log ( 'ERROR: unable to open ' + inputFile1 , db ) ; done ( 1 ) ; return ; } db1 = db ; if ( db1 && db2 ) { diffDatabases ( db1 , db2 , filter ) ; done ( 0 ) ; } } ) ; wtf . db . load ( inputFile2 , function ( db ) { if ( db instanceof Error ) { console . log ( 'ERROR: unable to open ' + inputFile2 , db ) ; done ( 1 ) ; return ; } db2 = db ; if ( db1 && db2 ) { diffDatabases ( db1 , db2 , filter ) ; done ( 0 ) ; } } ) ; }
Diff tool.
@param {!wtf.pal.IPlatform} platform Platform abstraction layer.
@param {!Array.<string>} args Command line arguments.
@param {function(number)} done Call to end the program with a return code.
Diff tool .