summaryrefslogtreecommitdiff
path: root/cli/args/mod.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-03-21 02:02:44 +0000
committerGitHub <noreply@github.com>2024-03-21 07:32:44 +0530
commite45f433a16f8b03fc11a75ae01287e24cf41bcb8 (patch)
tree90a28a2fcf1005a33be293be7277aaceb78e57ad /cli/args/mod.rs
parent2ce645137a6539411dad8d9fe359bc651b215ba5 (diff)
chore: make DENO_FUTURE a singleton (#23009)
Just making sure we read this env var once per process.
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r--cli/args/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index e7913eddc..d957b8f80 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -107,6 +107,9 @@ pub static DENO_DISABLE_PEDANTIC_NODE_WARNINGS: Lazy<bool> = Lazy::new(|| {
.is_some()
});
+static DENO_FUTURE: Lazy<bool> =
+ Lazy::new(|| std::env::var("DENO_FUTURE").ok().is_some());
+
pub fn jsr_url() -> &'static Url {
static JSR_URL: Lazy<Url> = 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<ModuleSpecifier, AnyError> {