Skip to content

Commit

Permalink
chore: add helpful message when --unstable-ffi is not passed (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd authored Apr 9, 2024
1 parent 4cce4d3 commit 7a6f45f
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 7a6f45f

Please sign in to comment.