From c9a9d040a3b6773f186c5757b246abca1803eeb6 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 13 Mar 2024 14:30:48 -0600 Subject: 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. --- cli/worker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli') 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(), -- cgit v1.2.3