2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2015-09-27 15:31:36 -07:00
|
|
|
require('../common');
|
2016-12-30 18:38:06 -05:00
|
|
|
const assert = require('assert');
|
2012-04-29 18:53:41 -07:00
|
|
|
|
|
|
|
// recursively calling .exit() should not overflow the call stack
|
2017-01-08 13:19:00 +00:00
|
|
|
let nexits = 0;
|
2012-04-29 18:53:41 -07:00
|
|
|
|
|
|
|
process.on('exit', function(code) {
|
2017-01-08 15:36:25 +00:00
|
|
|
assert.strictEqual(nexits++, 0);
|
|
|
|
assert.strictEqual(code, 1);
|
2012-04-29 18:53:41 -07:00
|
|
|
|
|
|
|
// now override the exit code of 1 with 0 so that the test passes
|
2013-09-06 18:23:02 -07:00
|
|
|
process.exit(0);
|
2012-04-29 18:53:41 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
process.exit(1);
|