diff options
Diffstat (limited to 'src/js/node/async_hooks.ts')
-rw-r--r-- | src/js/node/async_hooks.ts | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/js/node/async_hooks.ts b/src/js/node/async_hooks.ts index da9f6c136..2a671b6a2 100644 --- a/src/js/node/async_hooks.ts +++ b/src/js/node/async_hooks.ts @@ -21,7 +21,15 @@ // AsyncContextData is an immutable array managed in here, formatted [key, value, key, value] where // each key is an AsyncLocalStorage object and the value is the associated value. // -const { get, set, cleanupLater } = $lazy("async_hooks"); +const { cleanupLater } = $lazy("async_hooks"); + +function get(): ReadonlyArray<any> | undefined { + return $getInternalField($asyncContext, 0); +} + +function set(contextValue: ReadonlyArray<any> | undefined) { + return $putInternalField($asyncContext, 0, contextValue); +} class AsyncLocalStorage { #disableCalled = false; @@ -298,16 +306,6 @@ const asyncWrapProviders = { INSPECTORJSBINDING: 57, }; -export { - AsyncLocalStorage, - createHook, - executionAsyncId, - triggerAsyncId, - executionAsyncResource, - asyncWrapProviders, - AsyncResource, -}; - export default { AsyncLocalStorage, createHook, @@ -316,5 +314,4 @@ export default { executionAsyncResource, asyncWrapProviders, AsyncResource, - [Symbol.for("CommonJS")]: 0, }; |