1 var common = require('../common');
2 var assert = require('assert');
3 var spawn = require('child_process').spawn;
13 tests.forEach(function(test) {
14 console.log(test.name);
15 var child = spawn(process.execPath, [
16 '--abort-on-uncaught-exception',
21 child.stderr.pipe(process.stderr);
22 child.stdout.pipe(process.stdout);
23 child.on('exit', function(code) {
24 assert.strictEqual(code, 0);
29 var domain = require('domain');
30 var d = domain.create();
32 d.on('error', function(err) {
37 process.nextTick(function() {
38 throw new Error('exceptional!');
44 var domain = require('domain');
45 var d = domain.create();
47 d.on('error', function(err) {
52 setTimeout(function() {
53 throw new Error('exceptional!');
58 function timerPlusNextTick() {
59 var domain = require('domain');
60 var d = domain.create();
62 d.on('error', function(err) {
67 setTimeout(function() {
68 process.nextTick(function() {
69 throw new Error('exceptional!');
76 var domain = require('domain');
77 var d = domain.create();
79 d.on('error', function(err) {
84 throw new Error('exceptional!');
88 function netServer() {
89 var domain = require('domain');
90 var net = require('net');
91 var d = domain.create();
93 d.on('error', function(err) {
98 var server = net.createServer(function(conn) {
101 server.listen(Number(process.argv[1]), '0.0.0.0', function() {
102 var conn = net.connect(Number(process.argv[1]), '0.0.0.0')
103 conn.once('data', function() {
104 throw new Error('ok');