From 3d6fa64f19e74924813ece5e5fbd53023342bac8 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Mon, 20 Jun 2022 14:06:04 +0300 Subject: feat(ext/ffi): Callbacks (#14663) This commit adds support for unstable FFI callbacks. A callback is registered using the `Deno.UnsafeCallback` API. The backing memory for the callback can be disposed of using `Deno.UnsafeCallback#close`. It is not safe to pass the callback after calling close. Callbacks from other than the isolate thread are not supported. Co-authored-by: Divy Srivastava Co-authored-by: Bert Belder --- cli/tests/testdata/unstable_ffi_2.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'cli/tests/testdata/unstable_ffi_2.js') diff --git a/cli/tests/testdata/unstable_ffi_2.js b/cli/tests/testdata/unstable_ffi_2.js index de392fa7d..fe3d9d709 100644 --- a/cli/tests/testdata/unstable_ffi_2.js +++ b/cli/tests/testdata/unstable_ffi_2.js @@ -1,10 +1,5 @@ -Deno.core.opSync("op_ffi_call_ptr", { - pointer: [0, 0], - def: { - name: null, - parameters: [], - result: "void", - }, +Deno.core.opSync("op_ffi_call_ptr", 0n, { + name: null, parameters: [], - buffers: [], -}); + result: "void", +}, []); -- cgit v1.2.3