From c2a77cf7ec9de9eadf938046bdf78e58561c8a6d Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 2 Aug 2023 16:27:36 -0700 Subject: Rewrite built-in modules to use CommonJS over ESM (#3814) * stfdsafsd sadffdsa stuff finish commonjs stuff asdf not done but work not done but work not done yet but this is how far i am remove files lol update built files uncomment everything in events lol export default stuff * afdsafsd * its not perfect but almost done * okay * cool * remove temp file * finish rebase * revert settings.json * a * ch-ch-ch-ch-changes * okay * remove this check in release for now * sxdcfghnjm, * lkjhgf * fmt * filename can be null * Update NodeModuleModule.h * weee * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/js/node/async_hooks.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/js/node/async_hooks.ts') 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 | undefined { + return $getInternalField($asyncContext, 0); +} + +function set(contextValue: ReadonlyArray | 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, }; -- cgit v1.2.3