Skip to content

Commit aaba2b6

Browse files
mmastracnathanwhit
authored andcommitted
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.
1 parent b7f8f9a commit aaba2b6

File tree

2 files changed

+310
-299
lines changed

2 files changed

+310
-299
lines changed

cli/worker.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ mod tests {
867867
fn create_test_worker() -> MainWorker {
868868
let main_module =
869869
resolve_path("./hello.js", &std::env::current_dir().unwrap()).unwrap();
870-
let permissions = PermissionsContainer::new(Permissions::default());
870+
let permissions =
871+
PermissionsContainer::new(Permissions::none_without_prompt());
871872

872873
let options = WorkerOptions {
873874
startup_snapshot: crate::js::deno_isolate_init(),

0 commit comments

Comments
 (0)