summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-27 13:13:24 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-29 10:58:42 +0100
commit6e5ffc414782c6b85d439aaeb8e38d69f90eccdf (patch)
tree552265c07a80c881e1392817ba10bc7feec1b19a /test
parentf2dc99c127092c7535aedf954e371d5ffe426024 (diff)
downloadandroid-node-v8-6e5ffc414782c6b85d439aaeb8e38d69f90eccdf.tar.gz
android-node-v8-6e5ffc414782c6b85d439aaeb8e38d69f90eccdf.tar.bz2
android-node-v8-6e5ffc414782c6b85d439aaeb8e38d69f90eccdf.zip
test: move hasCrypto check
The hasCrypto check should be checked before anything else to prevent overhead in case it's not falsy. Otherwise the file would be read without any further benefit. PR-URL: https://github.com/nodejs/node/pull/26858 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/common/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/common/index.js b/test/common/index.js
index 49fce36e54..8c61fdc5cf 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -48,8 +48,11 @@ const hasCrypto = Boolean(process.versions.openssl);
// Check for flags. Skip this for workers (both, the `cluster` module and
// `worker_threads`) and child processes.
+// If the binary was built without-ssl then the crypto flags are
+// invalid (bad option). The test itself should handle this case.
if (process.argv.length === 2 &&
isMainThread &&
+ hasCrypto &&
module.parent &&
require('cluster').isMaster) {
// The copyright notice is relatively big and the flags could come afterwards.
@@ -74,9 +77,6 @@ if (process.argv.length === 2 &&
const args = process.execArgv.map((arg) => arg.replace(/_/g, '-'));
for (const flag of flags) {
if (!args.includes(flag) &&
- // If the binary was built without-ssl then the crypto flags are
- // invalid (bad option). The test itself should handle this case.
- hasCrypto &&
// If the binary is build without `intl` the inspect option is
// invalid. The test itself should handle this case.
(process.features.inspector || !flag.startsWith('--inspect'))) {