Skip to content
This repository
Browse code

domain: run now return callback result

both domain.bind and domain.intercept act this way
  • Loading branch information...
commit 535e109a3ab8cc756504a9204fdcd428cbae7cba 1 parent 77cfbd9
Andreas Madsen authored June 08, 2012 bnoordhuis committed June 09, 2012
2  lib/domain.js
@@ -136,7 +136,7 @@ Domain.prototype.remove = function(ee) {
136 136
 };
137 137
 
138 138
 Domain.prototype.run = function(fn) {
139  
-  this.bind(fn)();
  139
+  return this.bind(fn)();
140 140
 };
141 141
 
142 142
 Domain.prototype.intercept = function(cb) {
4  test/simple/test-domain.js
@@ -199,6 +199,10 @@ d.run(function() {
199 199
   });
200 200
 });
201 201
 
  202
+var result = d.run(function () {
  203
+  return 'return value';
  204
+});
  205
+assert.equal(result, 'return value');
202 206
 
203 207
 
204 208
 var fst = fs.createReadStream('stream for nonexistent file')

0 notes on commit 535e109

Please sign in to comment.
Something went wrong with that request. Please try again.