From 3a1a1cc030fb7fc90d51ee27162466d6ac924926 Mon Sep 17 00:00:00 2001 From: snek Date: Fri, 2 Aug 2024 08:14:35 -0700 Subject: feat: async context (#24402) We are switching to ContinuationPreservedEmbedderData. This allows adding async context tracking to the various async operations that deno provides. Fixes: https://github.com/denoland/deno/issues/7010 Fixes: https://github.com/denoland/deno/issues/22886 Fixes: https://github.com/denoland/deno/issues/24368 --- runtime/ops/runtime.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'runtime/ops') diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs index 306e6ce8f..b52a23f30 100644 --- a/runtime/ops/runtime.rs +++ b/runtime/ops/runtime.rs @@ -2,13 +2,14 @@ use deno_core::error::AnyError; use deno_core::op2; +use deno_core::v8; use deno_core::ModuleSpecifier; use deno_core::OpState; use deno_permissions::PermissionsContainer; deno_core::extension!( deno_runtime, - ops = [op_main_module, op_ppid], + ops = [op_main_module, op_ppid, op_get_extras_binding_object], options = { main_module: ModuleSpecifier }, state = |state, options| { state.put::(options.main_module); @@ -94,3 +95,11 @@ pub fn op_ppid() -> i64 { parent_id().into() } } + +#[op2] +pub fn op_get_extras_binding_object<'a>( + scope: &mut v8::HandleScope<'a>, +) -> v8::Local<'a, v8::Value> { + let context = scope.get_current_context(); + context.get_extras_binding_object(scope).into() +} -- cgit v1.2.3