summaryrefslogtreecommitdiff
path: root/cli/tools/standalone.rs
diff options
context:
space:
mode:
authorMaxim <59533214+biryukovmaxim@users.noreply.github.com>2022-02-11 22:04:31 +0300
committerGitHub <noreply@github.com>2022-02-11 14:04:31 -0500
commit65de5fb4658e92f0730901b8b083af375050bd64 (patch)
treef1b410613c31fcc6095e394ce59c10b447d01cab /cli/tools/standalone.rs
parent2fa0096821cd04334210fcae6f54f85d304dc17a (diff)
refactor: use `Arc` instead of making copies of `Flags` struct (#13610)
Diffstat (limited to 'cli/tools/standalone.rs')
-rw-r--r--cli/tools/standalone.rs29
1 files changed, 15 insertions, 14 deletions
diff --git a/cli/tools/standalone.rs b/cli/tools/standalone.rs
index ec957e195..84a1f00fb 100644
--- a/cli/tools/standalone.rs
+++ b/cli/tools/standalone.rs
@@ -99,7 +99,7 @@ pub fn create_standalone_binary(
unstable: flags.unstable,
seed: flags.seed,
location: flags.location.clone(),
- permissions: flags.clone().into(),
+ permissions: flags.permissions_options(),
v8_flags: flags.v8_flags.clone(),
unsafely_ignore_certificate_errors: flags
.unsafely_ignore_certificate_errors
@@ -200,7 +200,7 @@ pub async fn write_standalone_binary(
/// applicable at runtime so are set to their defaults like `false`.
/// - Other flags are inherited.
pub fn compile_to_runtime_flags(
- flags: Flags,
+ flags: &Flags,
baked_args: Vec<String>,
) -> Result<Flags, AnyError> {
// IMPORTANT: Don't abbreviate any of this to `..flags` or
@@ -212,40 +212,41 @@ pub fn compile_to_runtime_flags(
script: "placeholder".to_string(),
}),
allow_all: flags.allow_all,
- allow_env: flags.allow_env,
+ allow_env: flags.allow_env.clone(),
allow_hrtime: flags.allow_hrtime,
- allow_net: flags.allow_net,
- allow_ffi: flags.allow_ffi,
- allow_read: flags.allow_read,
- allow_run: flags.allow_run,
- allow_write: flags.allow_write,
- ca_stores: flags.ca_stores,
- ca_file: flags.ca_file,
+ allow_net: flags.allow_net.clone(),
+ allow_ffi: flags.allow_ffi.clone(),
+ allow_read: flags.allow_read.clone(),
+ allow_run: flags.allow_run.clone(),
+ allow_write: flags.allow_write.clone(),
+ ca_stores: flags.ca_stores.clone(),
+ ca_file: flags.ca_file.clone(),
cache_blocklist: vec![],
cache_path: None,
cached_only: false,
config_path: None,
- coverage_dir: flags.coverage_dir,
+ coverage_dir: flags.coverage_dir.clone(),
enable_testing_features: false,
ignore: vec![],
import_map_path: None,
inspect_brk: None,
inspect: None,
- location: flags.location,
+ location: flags.location.clone(),
lock_write: false,
lock: None,
log_level: flags.log_level,
check: CheckFlag::All,
compat: flags.compat,
unsafely_ignore_certificate_errors: flags
- .unsafely_ignore_certificate_errors,
+ .unsafely_ignore_certificate_errors
+ .clone(),
no_remote: false,
prompt: flags.prompt,
reload: false,
repl: false,
seed: flags.seed,
unstable: flags.unstable,
- v8_flags: flags.v8_flags,
+ v8_flags: flags.v8_flags.clone(),
version: false,
watch: None,
no_clear_screen: false,