Browse Source

domain: run now return callback result

both domain.bind and domain.intercept act this way
v0.9.1-release
Andreas Madsen 13 years ago
committed by Ben Noordhuis
parent
commit
535e109a3a
  1. 2
      lib/domain.js
  2. 4
      test/simple/test-domain.js

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) {

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')

Loading…
Cancel
Save