diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-12-04 16:05:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 21:05:40 +0000 |
commit | a24d3e8763bc48b69936db9231efb76766914303 (patch) | |
tree | 7091c5354d1e341c34e5847ea0271213c8730c69 /runtime | |
parent | 9eb25e3cff22d1f704ede0d4066abc846a26a919 (diff) |
perf(node/fs): faster `existsSync` when not exists (#21458)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/permissions/mod.rs | 8 | ||||
-rw-r--r-- | runtime/snapshot.rs | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index 75d4af1c7..7677b5c36 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -1376,8 +1376,12 @@ impl deno_node::NodePermissions for PermissionsContainer { } #[inline(always)] - fn check_read(&self, path: &Path) -> Result<(), AnyError> { - self.0.lock().read.check(path, None) + fn check_read_with_api_name( + &self, + path: &Path, + api_name: Option<&str>, + ) -> Result<(), AnyError> { + self.0.lock().read.check(path, api_name) } fn check_sys(&self, kind: &str, api_name: &str) -> Result<(), AnyError> { diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs index f7642573e..a0f0665b4 100644 --- a/runtime/snapshot.rs +++ b/runtime/snapshot.rs @@ -76,7 +76,11 @@ impl deno_node::NodePermissions for Permissions { ) -> Result<(), deno_core::error::AnyError> { unreachable!("snapshotting!") } - fn check_read(&self, _p: &Path) -> Result<(), deno_core::error::AnyError> { + fn check_read_with_api_name( + &self, + _p: &Path, + _api_name: Option<&str>, + ) -> Result<(), deno_core::error::AnyError> { unreachable!("snapshotting!") } fn check_sys( |