domain: run now return callback result
both domain.bind and domain.intercept act this way
This commit is contained in:
parent
77cfbd9f2d
commit
535e109a3a
@ -136,7 +136,7 @@ Domain.prototype.remove = function(ee) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Domain.prototype.run = function(fn) {
|
Domain.prototype.run = function(fn) {
|
||||||
this.bind(fn)();
|
return this.bind(fn)();
|
||||||
};
|
};
|
||||||
|
|
||||||
Domain.prototype.intercept = function(cb) {
|
Domain.prototype.intercept = function(cb) {
|
||||||
|
@ -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')
|
var fst = fs.createReadStream('stream for nonexistent file')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user