Comparing version 0.0.4 to 0.0.5
31
index.js
@@ -106,2 +106,5 @@ var EventEmitter = require('events').EventEmitter | ||
current_trace_error = trace_error; | ||
// Clear trace_error variable from the closure, so it can potentially be garbage collected. | ||
trace_error = null; | ||
try { | ||
@@ -130,11 +133,17 @@ callback.apply(this, arguments); | ||
EventEmitter.prototype.addListener = function(event, callback) { | ||
return _addListener.call(this, event, wrap_callback(callback, 'EventEmitter.addListener')); | ||
var args = Array.prototype.slice.call(arguments); | ||
args[1] = wrap_callback(callback, 'EventEmitter.addListener'); | ||
return _addListener.apply(this, args); | ||
}; | ||
EventEmitter.prototype.on = function(event, callback) { | ||
return _on.call(this, event, wrap_callback(callback, 'EventEmitter.on')); | ||
var args = Array.prototype.slice.call(arguments); | ||
args[1] = wrap_callback(callback, 'EventEmitter.on'); | ||
return _on.apply(this, args); | ||
}; | ||
EventEmitter.prototype.once = function(event, callback) { | ||
return _once.call(this, event, wrap_callback(callback, 'EventEmitter.once')); | ||
var args = Array.prototype.slice.call(arguments); | ||
args[1] = wrap_callback(callback, 'EventEmitter.once'); | ||
return _once.apply(this, args); | ||
}; | ||
@@ -175,3 +184,5 @@ | ||
process.nextTick = function(callback) { | ||
return _nextTick.call(this, wrap_callback(callback, 'process.nextTick')); | ||
var args = Array.prototype.slice.call(arguments); | ||
args[0] = wrap_callback(callback, 'process.nextTick'); | ||
return _nextTick.apply(this, args); | ||
}; | ||
@@ -184,8 +195,12 @@ | ||
global.setTimeout = function(callback, interval) { | ||
return _setTimeout.call(this, wrap_callback(callback, 'process.nextTick'), interval); | ||
global.setTimeout = function(callback) { | ||
var args = Array.prototype.slice.call(arguments); | ||
args[0] = wrap_callback(callback, 'process.nextTick'); | ||
return _setTimeout.apply(this, args); | ||
}; | ||
global.setInterval = function(callback, interval) { | ||
return _setInterval.call(this, wrap_callback(callback, 'process.nextTick'), interval); | ||
global.setInterval = function(callback) { | ||
var args = Array.prototype.slice.call(arguments); | ||
args[0] = wrap_callback(callback, 'process.nextTick'); | ||
return _setInterval.apply(this, args); | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Long stack traces for node.js inspired by https://github.com/tlrobinson/long-stack-traces", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -79,1 +79,6 @@ // These tests should be run one at a time. Comment the others out before running | ||
// should print foo 1 time | ||
should show { '0': 1, '1': 2, '2': 3 } | ||
setTimeout(function () {console.log(arguments);}, 1000, 1, 2, 3); | ||
//should show { '0': 1, '1': 2, '2': 3 } | ||
setInterval(function () {console.log(arguments);}, 1000, 1, 2, 3); |
11581
235