summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-03-13 14:30:48 -0600
committerGitHub <noreply@github.com>2024-03-13 14:30:48 -0600
commitc9a9d040a3b6773f186c5757b246abca1803eeb6 (patch)
tree7db7c78b1125490dace49b44d8b478c0dd192056 /cli/worker.rs
parenteca7b0cddd24074d6a3e255a45c0413f518a6303 (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.rs3
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(),