aboutsummaryrefslogtreecommitdiff
path: root/src/js/builtins/AsyncContext.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/builtins/AsyncContext.ts')
-rw-r--r--src/js/builtins/AsyncContext.ts9
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);
+}