diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-03-13 14:30:48 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 14:30:48 -0600 |
commit | c9a9d040a3b6773f186c5757b246abca1803eeb6 (patch) | |
tree | 7db7c78b1125490dace49b44d8b478c0dd192056 /cli/worker.rs | |
parent | eca7b0cddd24074d6a3e255a45c0413f518a6303 (diff) |
perf(permissions): Fast exit from checks when permission is in "fully-granted" state (#22894)
Skips the access check if the specific unary permission is in an
all-granted state. Generally prevents an allocation or two.
Hooks up a quiet "all" permission that is automatically inherited. This
permission will be used in the future to indicate that the user wishes
to accept all side-effects of the permissions they explicitly granted.
The "all" permission is an "ambient flag"-style permission that states
whether "allow-all" was passed on the command-line.
Diffstat (limited to 'cli/worker.rs')
-rw-r--r-- | cli/worker.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/worker.rs b/cli/worker.rs index 85867a405..a1872817f 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -867,7 +867,8 @@ mod tests { fn create_test_worker() -> MainWorker { let main_module = resolve_path("./hello.js", &std::env::current_dir().unwrap()).unwrap(); - let permissions = PermissionsContainer::new(Permissions::default()); + let permissions = + PermissionsContainer::new(Permissions::none_without_prompt()); let options = WorkerOptions { startup_snapshot: crate::js::deno_isolate_init(), |