Skip to content

Commit

Permalink
chore: add helpful message when --unstable-ffi is not passed
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd committed Apr 3, 2024
1 parent 4cce4d3 commit 5e3b7f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ export async function dlopen<S extends Deno.ForeignLibraryInterface>(
options: FetchOptions,
symbols: Const<S>,
): Promise<Deno.DynamicLibrary<S>> {
if (Deno.dlopen === undefined) {
throw new Error("`--unstable-ffi` is required");
}
// deno-lint-ignore no-explicit-any
return Deno.dlopen<S>(await download(options), symbols as any);
}

0 comments on commit 5e3b7f2

Please sign in to comment.