From 7e1218cd8f9856319e2c86e761e869ef48bf9c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 18 Jul 2023 15:13:17 +0200 Subject: fix(node): add process.dlopen API (#19860) Fixes https://github.com/denoland/deno/issues/19830 --- test_napi/common.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test_napi/common.js') diff --git a/test_napi/common.js b/test_napi/common.js index ce9b2544b..5ad0e9cf3 100644 --- a/test_napi/common.js +++ b/test_napi/common.js @@ -7,6 +7,7 @@ export { assertThrows, } from "../test_util/std/testing/asserts.ts"; export { fromFileUrl } from "../test_util/std/path/mod.ts"; +import process from "node:process"; const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); export const [libPrefix, libSuffix] = { @@ -15,13 +16,11 @@ export const [libPrefix, libSuffix] = { windows: ["", "dll"], }[Deno.build.os]; -const ops = Deno[Deno.internal].core.ops; - export function loadTestLibrary() { const specifier = `${targetDir}/${libPrefix}test_napi.${libSuffix}`; // Internal, used in ext/node - return ops.op_napi_open(specifier, { - Buffer: {}, - }); + const module = {}; + process.dlopen(module, specifier); + return module.exports; } -- cgit v1.2.3