Comparing version 0.3.4 to 0.3.5
15
index.js
@@ -74,9 +74,2 @@ #!/usr/bin/env node | ||
// This is intended to interact "cleverly" with node's EventEmitter logic. | ||
// EventEmitter itself sometimes wraps the event handler callbacks to implement | ||
// things such as once(). See https://github.com/nodejs/node/blob/v6.0.0/lib/events.js#L280 | ||
// In order for removeListener to still work when called with the original unwrapped function | ||
// a .listener member is added to the stored callback which contains the original unwrapped function | ||
// and the removeListener logic checks this member as well to match wrapped listeners. | ||
var stack = __stack; | ||
@@ -152,2 +145,8 @@ | ||
args[1] = wrapFn(args[1], args[1].name, null); | ||
// This is intended to interact "cleverly" with node's EventEmitter logic. | ||
// EventEmitter itself sometimes wraps the event handler callbacks to implement | ||
// things such as once(). See https://github.com/nodejs/node/blob/v6.0.0/lib/events.js#L280 | ||
// In order for removeListener to still work when called with the original unwrapped function | ||
// a .listener member is added to the callback which references the original unwrapped function | ||
// and the removeListener logic checks this member as well to match wrapped listeners. | ||
args[1].listener = arguments[1]; | ||
@@ -193,3 +192,3 @@ } | ||
// node 0.10 doesn't expose the ChildProcess constructor, so we have to get it on the sly | ||
var cp = require('child_process').spawn('true', { stdio: 'ignore' }); | ||
var cp = require('child_process').spawn('true', [], { stdio: 'ignore' }); | ||
ChildProcess = cp.constructor; | ||
@@ -196,0 +195,0 @@ } |
{ | ||
"name": "wtfnode", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Utility to help find out why Node isn't exiting", | ||
@@ -5,0 +5,0 @@ "repository": { |
22
test.js
@@ -42,1 +42,23 @@ 'use strict'; | ||
testEventEmitter(); | ||
function testInterval() { | ||
var timer; | ||
timer = setInterval(function () { | ||
throw new Error('Timer callback should not run'); | ||
}, 0); | ||
clearInterval(timer); | ||
timer = setTimeout(function () { | ||
throw new Error('Timer callback should not run'); | ||
}, 0); | ||
clearTimeout(timer); | ||
if (typeof setImmediate === 'undefined') { return; } | ||
timer = setImmediate(function () { | ||
throw new Error('Timer callback should not run'); | ||
}, 0); | ||
clearImmediate(timer); | ||
} | ||
testInterval(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25469
500