@@ -93,16 +93,6 @@ const emitDestroyNative = emitHookFactory(destroy_symbol, 'emitDestroyNative');
93
93
const emitPromiseResolveNative =
94
94
emitHookFactory ( promise_resolve_symbol , 'emitPromiseResolveNative' ) ;
95
95
96
- // Setup the callbacks that node::AsyncWrap will call when there are hooks to
97
- // process. They use the same functions as the JS embedder API. These callbacks
98
- // are setup immediately to prevent async_wrap.setupHooks() from being hijacked
99
- // and the cost of doing so is negligible.
100
- async_wrap . setupHooks ( { init : emitInitNative ,
101
- before : emitBeforeNative ,
102
- after : emitAfterNative ,
103
- destroy : emitDestroyNative ,
104
- promise_resolve : emitPromiseResolveNative } ) ;
105
-
106
96
// Used to fatally abort the process if a callback throws.
107
97
function fatalError ( e ) {
108
98
if ( typeof e . stack === 'string' ) {
@@ -462,4 +452,11 @@ module.exports = {
462
452
emitAfter : emitAfterScript ,
463
453
emitDestroy : emitDestroyScript ,
464
454
registerDestroyHook,
455
+ nativeHooks : {
456
+ init : emitInitNative ,
457
+ before : emitBeforeNative ,
458
+ after : emitAfterNative ,
459
+ destroy : emitDestroyNative ,
460
+ promise_resolve : emitPromiseResolveNative
461
+ }
465
462
} ;
0 commit comments