diff options
author | 2023-07-19 17:20:00 -0700 | |
---|---|---|
committer | 2023-07-19 17:20:00 -0700 | |
commit | 9b6dc49575df5fb953918c284505f24741138130 (patch) | |
tree | 3a052876fa8c6524e0c8d18479aabe38e2d5a52a /src/js/builtins/AsyncContext.ts | |
parent | 723e9d1ea7c7fdb424ecedd0fb023524366322c4 (diff) | |
download | bun-9b6dc49575df5fb953918c284505f24741138130.tar.gz bun-9b6dc49575df5fb953918c284505f24741138130.tar.zst bun-9b6dc49575df5fb953918c284505f24741138130.zip |
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
Diffstat (limited to 'src/js/builtins/AsyncContext.ts')
-rw-r--r-- | src/js/builtins/AsyncContext.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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<any> | undefined { + return $getInternalField($asyncContext, 0); +} + +export function setAsyncContext(contextValue: ReadonlyArray<any> | undefined) { + return $putInternalField($asyncContext, 0, contextValue); +} |