2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2012-12-27 12:08:23 -08:00
|
|
|
// Make sure that the nested domains don't cause the domain stack to grow
|
|
|
|
|
2015-09-27 15:31:36 -07:00
|
|
|
require('../common');
|
2016-12-30 18:38:06 -05:00
|
|
|
const assert = require('assert');
|
|
|
|
const domain = require('domain');
|
2012-12-27 12:08:23 -08:00
|
|
|
|
|
|
|
process.on('exit', function(c) {
|
2017-01-08 15:36:25 +00:00
|
|
|
assert.strictEqual(domain._stack.length, 0);
|
2012-12-27 12:08:23 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
domain.create().run(function() {
|
|
|
|
domain.create().run(function() {
|
|
|
|
domain.create().run(function() {
|
2015-05-19 13:00:06 +02:00
|
|
|
domain.create().on('error', function(e) {
|
2012-12-27 12:08:23 -08:00
|
|
|
// Don't need to do anything here
|
|
|
|
}).run(function() {
|
2015-05-19 13:00:06 +02:00
|
|
|
throw new Error('died');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|