mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 08:19:38 +01:00
3e1b1dd4a9
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
29 lines
569 B
JavaScript
29 lines
569 B
JavaScript
// Make sure that the domain stack doesn't get out of hand.
|
|
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var domain = require('domain');
|
|
var events = require('events');
|
|
|
|
var a = domain.create();
|
|
a.name = 'a';
|
|
|
|
a.on('error', function() {
|
|
if (domain._stack.length > 5) {
|
|
console.error('leaking!', domain._stack);
|
|
process.exit(1);
|
|
}
|
|
});
|
|
|
|
var foo = a.bind(function() {
|
|
throw new Error('error from foo');
|
|
});
|
|
|
|
for (var i = 0; i < 1000; i++) {
|
|
process.nextTick(foo);
|
|
}
|
|
|
|
process.on('exit', function(c) {
|
|
if (!c) console.log('ok');
|
|
});
|