|
@ -86,11 +86,13 @@ |
|
|
return startup._lazyConstants; |
|
|
return startup._lazyConstants; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var assert; |
|
|
startup.processAssert = function() { |
|
|
startup.processAssert = function() { |
|
|
process.assert = function(x, msg) { |
|
|
// Note that calls to assert() are pre-processed out by JS2C for the
|
|
|
if (!x) { |
|
|
// normal build of node. They persist only in the node_g build.
|
|
|
throw new Error(msg || 'assertion error'); |
|
|
// Similarly for debug().
|
|
|
} |
|
|
assert = process.assert = function(x, msg) { |
|
|
|
|
|
if (!x) throw new Error(msg || 'assertion error'); |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -229,7 +231,7 @@ |
|
|
process.removeListener = function(type, listener) { |
|
|
process.removeListener = function(type, listener) { |
|
|
var ret = removeListener.apply(this, arguments); |
|
|
var ret = removeListener.apply(this, arguments); |
|
|
if (isSignal(type)) { |
|
|
if (isSignal(type)) { |
|
|
process.assert(signalWatchers.hasOwnProperty(type)); |
|
|
assert(signalWatchers.hasOwnProperty(type)); |
|
|
|
|
|
|
|
|
if (this.listeners(type).length === 0) { |
|
|
if (this.listeners(type).length === 0) { |
|
|
signalWatchers[type].stop(); |
|
|
signalWatchers[type].stop(); |
|
|