2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2012-08-02 13:37:02 +02:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
|
|
|
var net = require('net');
|
|
|
|
|
|
|
|
var gotError = false;
|
|
|
|
|
|
|
|
process.on('exit', function() {
|
2014-01-27 17:39:45 -08:00
|
|
|
assert(gotError instanceof Error);
|
2012-08-02 13:37:02 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
// this should fail with an async EINVAL error, not throw an exception
|
2015-10-20 11:40:54 -07:00
|
|
|
net.createServer(common.fail).listen({fd:0}).on('error', function(e) {
|
2015-08-18 16:32:07 -07:00
|
|
|
switch (e.code) {
|
2014-01-27 17:39:45 -08:00
|
|
|
case 'EINVAL':
|
|
|
|
case 'ENOTSOCK':
|
|
|
|
gotError = e;
|
2015-05-19 13:00:06 +02:00
|
|
|
break;
|
2014-01-27 17:39:45 -08:00
|
|
|
}
|
2012-08-02 13:37:02 +02:00
|
|
|
});
|