cli: fix env vars missing from node --help#63893
Open
watilde wants to merge 1 commit into
Open
Conversation
The `envVars` table in print_help.js was built with a malformed
expression that silently dropped entries from the help output:
1. The closing parenthesis of `ArrayPrototypeConcat()` was placed
after the `hasIntl` argument, so the `hasNodeOptions` and
`hasCrypto` lists were passed as extra arguments to `new SafeMap()`,
which ignores everything after the first. As a result NODE_OPTIONS,
OPENSSL_CONF, SSL_CERT_DIR and SSL_CERT_FILE never appeared.
2. The NODE_ICU_DATA helpText used `'...' + hasSmallICU ? '' : '...'`,
which parses as `('...' + hasSmallICU) ? '' : '...'` and is always
the empty string. Since format() skips entries with falsy helpText,
the NODE_ICU_DATA entry was dropped as well.
The existing test only checked for the bare `NODE_ICU_DATA` and
`OPENSSL_CONF` substrings, which also occur in the `--icu-data-dir`
and `--openssl-config` descriptions, so the missing entries went
unnoticed. The added test parses the "Environment variables:" section
and asserts each entry appears at the start of a line.
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
envVarstable in print_help.js was built with a malformed expression that silently dropped entries from the help output:The closing parenthesis of
ArrayPrototypeConcat()was placed after thehasIntlargument, so thehasNodeOptionsandhasCryptolists were passed as extra arguments tonew SafeMap(), which ignores everything after the first. As a result NODE_OPTIONS, OPENSSL_CONF, SSL_CERT_DIR and SSL_CERT_FILE never appeared.The NODE_ICU_DATA helpText used
'...' + hasSmallICU ? '' : '...', which parses as('...' + hasSmallICU) ? '' : '...'and is always the empty string. Since format() skips entries with falsy helpText, the NODE_ICU_DATA entry was dropped as well.The existing test only checked for the bare
NODE_ICU_DATAandOPENSSL_CONFsubstrings, which also occur in the--icu-data-dirand--openssl-configdescriptions, so the missing entries went unnoticed. The added test parses the "Environment variables:" section and asserts each entry appears at the start of a line.