mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(ext/node): return values in node:domain (#29440)
When using Domain#bind, Domain#intercept, and Domain#run we were invoking the callback but then not actually returning the value returned from that callback. This makes Gulp work with async functions as tasks.
This commit is contained in:
parent
32db2db121
commit
a88c61de3d
1 changed files with 7 additions and 3 deletions
|
@ -50,7 +50,7 @@ export class Domain extends EventEmitter {
|
|||
const self = this;
|
||||
return function () {
|
||||
try {
|
||||
FunctionPrototypeApply(fn, null, ArrayPrototypeSlice(arguments));
|
||||
return FunctionPrototypeApply(fn, null, ArrayPrototypeSlice(arguments));
|
||||
} catch (e) {
|
||||
FunctionPrototypeCall(emitError, self, e);
|
||||
}
|
||||
|
@ -65,7 +65,11 @@ export class Domain extends EventEmitter {
|
|||
FunctionPrototypeCall(emitError, self, e);
|
||||
} else {
|
||||
try {
|
||||
FunctionPrototypeApply(fn, null, ArrayPrototypeSlice(arguments, 1));
|
||||
return FunctionPrototypeApply(
|
||||
fn,
|
||||
null,
|
||||
ArrayPrototypeSlice(arguments, 1),
|
||||
);
|
||||
} catch (e) {
|
||||
FunctionPrototypeCall(emitError, self, e);
|
||||
}
|
||||
|
@ -75,7 +79,7 @@ export class Domain extends EventEmitter {
|
|||
|
||||
run(fn) {
|
||||
try {
|
||||
fn();
|
||||
return fn();
|
||||
} catch (e) {
|
||||
FunctionPrototypeCall(emitError, this, e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue