diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-06-13 13:46:35 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-06-21 21:18:20 +0300 |
commit | 1bbe66f432591aea83555d27dd76c55fea040a0d (patch) | |
tree | 112ae06f8c3c305341967af71acbeb82c1b0d02f /src/env.cc | |
parent | 86d6d816fd41bb015488c8a0022cc9cf4d1a174b (diff) |
src: allow to negate boolean CLI flags
This change allows all boolean flags to be negated using the `--no-`
prefix.
Flags that are `true` by default (for example `--deprecation`) are
still documented as negations.
With this change, it becomes possible to easily flip the default
value of a boolean flag and to override the value of a flag passed
in the NODE_OPTIONS environment variable.
`process.allowedNodeEnvironmentFlags` contains both the negated and
non-negated versions of boolean flags.
Co-authored-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/39023
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/env.cc b/src/env.cc index 9f6172de82b..1cc7da1ce15 100644 --- a/src/env.cc +++ b/src/env.cc @@ -447,7 +447,7 @@ void Environment::InitializeMainContext(Local<Context> context, CreateProperties(); } - if (options_->no_force_async_hooks_checks) { + if (!options_->force_async_hooks_checks) { async_hooks_.no_force_checks(); } |