mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
chore: make DENO_FUTURE a singleton (#23009)
Just making sure we read this env var once per process.
This commit is contained in:
parent
2ce645137a
commit
e45f433a16
1 changed files with 4 additions and 1 deletions
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue