domain: run now return callback result

both domain.bind and domain.intercept act this way
This commit is contained in:
Andreas Madsen authored and Ben Noordhuis committed 2012-06-09 18:15:38 +02:00
1 parent 77cfbd9f2d
commit 535e109a3a
2 files changed
+5 -1

No files matched your search

+1 -1
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) {
+4
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')