Skip to content

Commit 693a83d

Browse files
committed
async_hooks: remove unused useDomainTrampoline
Remove the useDomainTrampoline function and related domain_cb variable that are no longer used after domain was ported to AsyncLocalStorage.
1 parent 1d24947 commit 693a83d

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/internal/async_hooks.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,14 @@ const emitDestroyNative = emitHookFactory(destroy_symbol, 'emitDestroyNative');
111111
const emitPromiseResolveNative =
112112
emitHookFactory(promise_resolve_symbol, 'emitPromiseResolveNative');
113113

114-
let domain_cb;
115-
function useDomainTrampoline(fn) {
116-
domain_cb = fn;
117-
}
118-
119114
function callbackTrampoline(asyncId, resource, cb, ...args) {
120115
const index = async_hook_fields[kStackLength] - 1;
121116
execution_async_resources[index] = resource;
122117

123118
if (asyncId !== 0 && hasHooks(kBefore))
124119
emitBeforeNative(asyncId);
125120

126-
let result;
127-
if (asyncId === 0 && typeof domain_cb === 'function') {
128-
args.unshift(cb);
129-
result = ReflectApply(domain_cb, this, args);
130-
} else {
131-
result = ReflectApply(cb, this, args);
132-
}
121+
const result = ReflectApply(cb, this, args);
133122

134123
if (asyncId !== 0 && hasHooks(kAfter))
135124
emitAfterNative(asyncId);
@@ -623,7 +612,6 @@ module.exports = {
623612
pushAsyncContext,
624613
popAsyncContext,
625614
registerDestroyHook,
626-
useDomainTrampoline,
627615
nativeHooks: {
628616
init: emitInitNative,
629617
before: emitBeforeNative,

0 commit comments

Comments
 (0)