var assert = require('assert');

module.exports = tapsert = recordAssert(assert);

for (var a in assert) {
  tapsert[a] = recordAssert(assert[a]);
}

var assertions = 0;
var failures = 0;

function recordAssert(assert) {
  return function() {
    var desc = (arguments.length === assert.length
                ? arguments[arguments.length-1]
                : '');
    if (assertions === 0)
      console.log('TAP version 13');
    var n = assertions += 1;
    try {
      assert.apply(null, arguments);
      console.log('ok %d - %s', n, desc);
    } catch (e) {
      failures += 1;
      console.log('not ok %d - %s', n, desc)
    }
  };
}

process.on('exit', function() {
  console.log('1..%d', assertions);
  process.exit(failures);
});

@@ -26,16 +26,30 @@
 ert');%0A%0A
+var tapsert = 
 module.e
@@ -64,21 +64,11 @@
  tap
-sert = record
+ify
 Asse
@@ -119,22 +119,22 @@
 rt%5Ba%5D = 
-record
+tapify
 Assert(a
@@ -199,14 +199,14 @@
 ion 
-record
+tapify
 Asse
@@ -227,24 +227,58 @@
  return 
-function
+tapifiedAssert;%0A%0A  function tapifiedAssert
 () %7B%0A   
@@ -670,17 +670,16 @@
    %7D%0A  %7D
-;
 %0A%7D%0A%0Aproc

Fix leaked global