From 9b6dc49575df5fb953918c284505f24741138130 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 19 Jul 2023 17:20:00 -0700 Subject: Implement `AsyncLocalStorage` (#3089) * work to get async local storage working. * a * a * everything but queueMicrotask * sdfghj * . * finish * tests * test * ok * done * im so stupid * Upgrade WebKit * refactor * refactor * changes requested * oops * cool * fix runInAsyncScope --- src/js/builtins/AsyncContext.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/js/builtins/AsyncContext.ts (limited to 'src/js/builtins/AsyncContext.ts') diff --git a/src/js/builtins/AsyncContext.ts b/src/js/builtins/AsyncContext.ts new file mode 100644 index 000000000..1c55feeba --- /dev/null +++ b/src/js/builtins/AsyncContext.ts @@ -0,0 +1,9 @@ +// Used by async_hooks to manipulate the async context + +export function getAsyncContext(): ReadonlyArray | undefined { + return $getInternalField($asyncContext, 0); +} + +export function setAsyncContext(contextValue: ReadonlyArray | undefined) { + return $putInternalField($asyncContext, 0, contextValue); +} -- cgit v1.2.3