diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-09-20 01:17:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-20 01:17:35 +0200 |
| commit | b657d743a22802b8232fbf558f2f00bf2942096f (patch) | |
| tree | e3a3047e78b6bd9c9e3f551f99f5e80e32de079d /cli/ops/fs_events.rs | |
| parent | aaa5e6613a739f8e2ff7579b69c2504bcdc37d4f (diff) | |
refactor: remove CliState, use OpState, add CliModuleLoader (#7588)
- remove "CliState.workers" and "CliState.next_worker_id", instead
store them on "OpState" using type aliases.
- remove "CliState.global_timer" and "CliState.start_time", instead
store them on "OpState" using type aliases.
- remove "CliState.is_internal", instead pass it to Worker::new
- move "CliState::permissions" to "OpState"
- move "CliState::main_module" to "OpState"
- move "CliState::global_state" to "OpState"
- move "CliState::check_unstable()" to "GlobalState"
- change "cli_state()" to "global_state()"
- change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks
- rename "CliState" to "CliModuleLoader"
Diffstat (limited to 'cli/ops/fs_events.rs')
| -rw-r--r-- | cli/ops/fs_events.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/ops/fs_events.rs b/cli/ops/fs_events.rs index bba68f4e4..a79784c5a 100644 --- a/cli/ops/fs_events.rs +++ b/cli/ops/fs_events.rs @@ -1,5 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +use crate::permissions::Permissions; use deno_core::error::bad_resource_id; use deno_core::error::AnyError; use deno_core::BufVec; @@ -91,7 +92,9 @@ fn op_fs_events_open( RecursiveMode::NonRecursive }; for path in &args.paths { - super::cli_state(state).check_read(&PathBuf::from(path))?; + state + .borrow::<Permissions>() + .check_read(&PathBuf::from(path))?; watcher.watch(path, recursive_mode)?; } let resource = FsEventsResource { watcher, receiver }; |
