From d20c9e75d1540b1a27e721d0cf66d29ba6a2c3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 22 Jan 2024 18:37:28 +0100 Subject: refactor: add "UnstableConfig" struct to cli/args/flags.rs (#21993) This commit adds "UnstableConfig" struct which centralizes handling of all "--unstable-*" flags. Closes https://github.com/denoland/deno/issues/21920 --- cli/standalone/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/standalone/mod.rs') diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 8a98636a4..7054e3451 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -487,10 +487,10 @@ pub async fn run( // TODO(bartlomieju): enable, once we deprecate `--unstable` in favor // of granular --unstable-* flags. // feature_checker.set_warn_cb(Box::new(crate::unstable_warn_cb)); - if metadata.unstable { + if metadata.unstable_config.legacy_flag_enabled { checker.enable_legacy_unstable(); } - for feature in metadata.unstable_features { + for feature in metadata.unstable_config.features { // `metadata` is valid for the whole lifetime of the program, so we // can leak the string here. checker.enable_feature(feature.leak()); @@ -535,7 +535,7 @@ pub async fn run( seed: metadata.seed, unsafely_ignore_certificate_errors: metadata .unsafely_ignore_certificate_errors, - unstable: metadata.unstable, + unstable: metadata.unstable_config.legacy_flag_enabled, maybe_root_package_json_deps: package_json_deps_provider.deps().cloned(), }, None, -- cgit v1.2.3