diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-10-05 07:06:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 19:36:44 +0530 |
commit | 0b016a7fb8639ce49603c8c339539174b191a4b1 (patch) | |
tree | c511060d701db60ede0214b7280e89c5749bbe62 /runtime/permissions.rs | |
parent | 3a3a8484069c9c6955fcb83ea761f9f74638175a (diff) |
feat(npm): implement Node API (#13633)
This PR implements the NAPI for loading native modules into Deno.
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'runtime/permissions.rs')
-rw-r--r-- | runtime/permissions.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/permissions.rs b/runtime/permissions.rs index 1568410b3..ec2f146ae 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -1656,6 +1656,14 @@ impl deno_websocket::WebSocketPermissions for Permissions { } } +// NOTE(bartlomieju): for now, NAPI uses `--allow-ffi` flag, but that might +// change in the future. +impl deno_napi::NapiPermissions for Permissions { + fn check(&mut self, path: Option<&Path>) -> Result<(), AnyError> { + self.ffi.check(path) + } +} + impl deno_ffi::FfiPermissions for Permissions { fn check(&mut self, path: Option<&Path>) -> Result<(), AnyError> { self.ffi.check(path) |