From 695da9ee291c67f2e6caa547b3ef2720dde6cb6b Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Fri, 9 Sep 2022 19:45:39 -0700 Subject: [PATCH] Fix import path issue in ffi bench --- bench/ffi/bun.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bench/ffi/bun.js b/bench/ffi/bun.js index ec086c73ab..593473929f 100644 --- a/bench/ffi/bun.js +++ b/bench/ffi/bun.js @@ -1,6 +1,8 @@ +import { ptr, dlopen, CString, toBuffer } from "bun:ffi"; import { run, bench, group } from "mitata"; -import { ptr, dlopen, CString } from "bun:ffi"; -const { napiNoop, napiHash, napiString } = require("./src/ffi_napi_bench.node"); + +const { napiNoop, napiHash, napiString } = require(import.meta.dir + + "/src/ffi_napi_bench.node"); const { symbols: { @@ -8,7 +10,7 @@ const { ffi_hash: { native: ffi_hash }, ffi_string: { native: ffi_string }, }, -} = dlopen("./src/ffi_napi_bench.node", { +} = dlopen(import.meta.dir + "/src/ffi_napi_bench.node", { ffi_noop: { args: [], returns: "void" }, ffi_string: { args: [], returns: "ptr" }, ffi_hash: { args: ["ptr", "u32"], returns: "u32" },