From e45f433a16f8b03fc11a75ae01287e24cf41bcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Mar 2024 02:02:44 +0000 Subject: [PATCH] chore: make DENO_FUTURE a singleton (#23009) Just making sure we read this env var once per process. --- cli/args/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/args/mod.rs b/cli/args/mod.rs index e7913eddc8..d957b8f80e 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -107,6 +107,9 @@ pub static DENO_DISABLE_PEDANTIC_NODE_WARNINGS: Lazy = Lazy::new(|| { .is_some() }); +static DENO_FUTURE: Lazy = + Lazy::new(|| std::env::var("DENO_FUTURE").ok().is_some()); + pub fn jsr_url() -> &'static Url { static JSR_URL: Lazy = Lazy::new(|| { let env_var_name = "JSR_URL"; @@ -978,7 +981,7 @@ impl CliOptions { } pub fn enable_future_features(&self) -> bool { - std::env::var("DENO_FUTURE").is_ok() + *DENO_FUTURE } pub fn resolve_main_module(&self) -> Result {