2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2015-12-23 16:02:12 -08:00
|
|
|
require('../common');
|
2011-12-05 22:42:05 +01:00
|
|
|
var assert = require('assert');
|
|
|
|
|
2012-04-29 18:53:41 -07:00
|
|
|
// calling .exit() from within "exit" should not overflow the call stack
|
2011-12-05 22:42:05 +01:00
|
|
|
var nexits = 0;
|
|
|
|
|
2012-04-29 18:53:41 -07:00
|
|
|
process.on('exit', function(code) {
|
2011-12-05 22:42:05 +01:00
|
|
|
assert.equal(nexits++, 0);
|
2012-04-29 18:53:41 -07:00
|
|
|
assert.equal(code, 0);
|
2011-12-05 22:42:05 +01:00
|
|
|
process.exit();
|
|
|
|
});
|
|
|
|
|
2012-04-29 18:53:41 -07:00
|
|
|
// "exit" should be emitted unprovoked
|