diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-08-24 14:09:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 15:09:00 +0200 |
commit | 1b7848c4a9f6ba848452c9b3a9e88e95c17ab295 (patch) | |
tree | a33800c5cf9e0ce879cc958eee64d0b3623d769d /ext/ffi/00_ffi.js | |
parent | 8c57a6b7e3e53506c6b62f76cdb51745ff6d4036 (diff) |
feat(unstable): Support file URLs in Deno.dlopen() (#11658)
Diffstat (limited to 'ext/ffi/00_ffi.js')
-rw-r--r-- | ext/ffi/00_ffi.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/ffi/00_ffi.js b/ext/ffi/00_ffi.js index 3c4112a47..553ea1dd3 100644 --- a/ext/ffi/00_ffi.js +++ b/ext/ffi/00_ffi.js @@ -3,6 +3,7 @@ ((window) => { const core = window.Deno.core; + const __bootstrap = window.__bootstrap; class DynamicLibrary { #rid; @@ -23,7 +24,9 @@ } function dlopen(path, symbols) { - return new DynamicLibrary(path, symbols); + // URL support is progressively enhanced by util in `runtime/js`. + const pathFromURL = __bootstrap.util.pathFromURL ?? ((p) => p); + return new DynamicLibrary(pathFromURL(path), symbols); } window.__bootstrap.ffi = { dlopen }; |