process: Fix regression from a5dba82

Respect numeric string args to process.exit(code)
This commit is contained in:
isaacs
2013-09-06 18:23:02 -07:00
parent 6808706c3b
commit 39aafcf801
2 changed files with 2 additions and 2 deletions

View File

@@ -547,7 +547,7 @@
startup.processKillAndExit = function() {
process.exitCode = 0;
process.exit = function(code) {
if (NativeModule.require('util').isNumber(code))
if (code || code === 0)
process.exitCode = code;
if (!process._exiting) {

View File

@@ -29,7 +29,7 @@ process.on('exit', function(code) {
assert.equal(code, 1);
// now override the exit code of 1 with 0 so that the test passes
process.exit();
process.exit(0);
});
process.exit(1);