mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
f29762f4dd
Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
30 lines
583 B
JavaScript
30 lines
583 B
JavaScript
'use strict';
|
|
// 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');
|
|
});
|