Permalink
Browse files

domain: run now return callback result

both domain.bind and domain.intercept act this way
  • Loading branch information...
1 parent 77cfbd9 commit 535e109a3ab8cc756504a9204fdcd428cbae7cba @AndreasMadsen AndreasMadsen committed with bnoordhuis Jun 8, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/domain.js
  2. +4 −0 test/simple/test-domain.js
View
2 lib/domain.js
@@ -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
4 test/simple/test-domain.js
@@ -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')

0 comments on commit 535e109

Please sign in to comment.