domain: run now return callback result

both domain.bind and domain.intercept act this way
This commit is contained in:
Andreas Madsen 2012-06-08 20:06:10 +02:00 committed by Ben Noordhuis
parent 77cfbd9f2d
commit 535e109a3a
2 changed files with 5 additions and 1 deletions

View File

@ -136,7 +136,7 @@ Domain.prototype.remove = function(ee) {
};
Domain.prototype.run = function(fn) {
this.bind(fn)();
return this.bind(fn)();
};
Domain.prototype.intercept = function(cb) {

View File

@ -199,6 +199,10 @@ d.run(function() {
});
});
var result = d.run(function () {
return 'return value';
});
assert.equal(result, 'return value');
var fst = fs.createReadStream('stream for nonexistent file')