diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-07-18 15:13:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 15:13:17 +0200 |
commit | 7e1218cd8f9856319e2c86e761e869ef48bf9c5f (patch) | |
tree | 331c0b36e44cfd0c60ee270b2bd34a1faa2e08c7 /test_napi/common.js | |
parent | 8a48fcc9d3ee83ef2a02fe3db056f16a1276c540 (diff) |
fix(node): add process.dlopen API (#19860)
Fixes https://github.com/denoland/deno/issues/19830
Diffstat (limited to 'test_napi/common.js')
-rw-r--r-- | test_napi/common.js | 9 |
1 files changed, 4 insertions, 5 deletions
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; } |