1'use strict'; 2 3const common = require('../common'); 4const assert = require('assert'); 5const domain = require('domain'); 6const fs = require('fs'); 7 8const d = new domain.Domain(); 9 10const fst = fs.createReadStream('stream for nonexistent file'); 11 12d.on('error', common.mustCall((err) => { 13 assert.ok(err.message.match(/^ENOENT: no such file or directory, open '/)); 14 assert.strictEqual(err.domain, d); 15 assert.strictEqual(err.domainEmitter, fst); 16 assert.strictEqual(err.domainBound, undefined); 17 assert.strictEqual(err.domainThrown, false); 18})); 19 20d.add(fst); 21