mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
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) {
|
||||
this.bind(fn)();
|
||||
return this.bind(fn)();
|
||||
};
|
||||
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user