diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-01-30 23:19:45 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2019-02-02 05:41:45 +0800 |
commit | c2359bdad62b83d40976d91e91097684c23a7ae3 (patch) | |
tree | ede78a4d84d9f2c3d661fed39c3a4cf4294d8104 /test/parallel | |
parent | 39d922123c02aecc2e289a08e3bdb9515a7b193a (diff) | |
download | android-node-v8-c2359bdad62b83d40976d91e91097684c23a7ae3.tar.gz android-node-v8-c2359bdad62b83d40976d91e91097684c23a7ae3.tar.bz2 android-node-v8-c2359bdad62b83d40976d91e91097684c23a7ae3.zip |
process: expose process.features.inspector
Instead of using process.config.variables.v8_enable_inspector
to detect whether inspector is enabled in the build.
PR-URL: https://github.com/nodejs/node/pull/25819
Refs: https://github.com/nodejs/node/issues/25343
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel')
-rw-r--r-- | test/parallel/test-cli-bad-options.js | 2 | ||||
-rw-r--r-- | test/parallel/test-cli-node-print-help.js | 3 | ||||
-rw-r--r-- | test/parallel/test-module-cjs-helpers.js | 4 | ||||
-rw-r--r-- | test/parallel/test-process-env-allowed-flags.js | 2 | ||||
-rw-r--r-- | test/parallel/test-process-features.js | 1 | ||||
-rw-r--r-- | test/parallel/test-repl-tab-complete.js | 2 | ||||
-rw-r--r-- | test/parallel/test-v8-coverage.js | 2 |
7 files changed, 7 insertions, 9 deletions
diff --git a/test/parallel/test-cli-bad-options.js b/test/parallel/test-cli-bad-options.js index 7abd330aa4..3fc8980c14 100644 --- a/test/parallel/test-cli-bad-options.js +++ b/test/parallel/test-cli-bad-options.js @@ -6,7 +6,7 @@ require('../common'); const assert = require('assert'); const spawn = require('child_process').spawnSync; -if (process.config.variables.v8_enable_inspector === 1) { +if (process.features.inspector) { requiresArgument('--inspect-port'); requiresArgument('--inspect-port='); requiresArgument('--debug-port'); diff --git a/test/parallel/test-cli-node-print-help.js b/test/parallel/test-cli-node-print-help.js index 433a95faf2..e115124b04 100644 --- a/test/parallel/test-cli-node-print-help.js +++ b/test/parallel/test-cli-node-print-help.js @@ -22,10 +22,9 @@ function startPrintHelpTest() { } function validateNodePrintHelp() { - const config = process.config; const HAVE_OPENSSL = common.hasCrypto; const NODE_HAVE_I18N_SUPPORT = common.hasIntl; - const HAVE_INSPECTOR = config.variables.v8_enable_inspector === 1; + const HAVE_INSPECTOR = process.features.inspector; const cliHelpOptions = [ { compileConstant: HAVE_OPENSSL, diff --git a/test/parallel/test-module-cjs-helpers.js b/test/parallel/test-module-cjs-helpers.js index ccf95f3e81..12de65598e 100644 --- a/test/parallel/test-module-cjs-helpers.js +++ b/test/parallel/test-module-cjs-helpers.js @@ -5,7 +5,5 @@ require('../common'); const assert = require('assert'); const { builtinLibs } = require('internal/modules/cjs/helpers'); -const hasInspector = process.config.variables.v8_enable_inspector === 1; - -const expectedLibs = hasInspector ? 34 : 33; +const expectedLibs = process.features.inspector ? 34 : 33; assert.strictEqual(builtinLibs.length, expectedLibs); diff --git a/test/parallel/test-process-env-allowed-flags.js b/test/parallel/test-process-env-allowed-flags.js index dfa2129b26..ad0e05f69b 100644 --- a/test/parallel/test-process-env-allowed-flags.js +++ b/test/parallel/test-process-env-allowed-flags.js @@ -16,7 +16,7 @@ require('../common'); 'r', '--stack-trace-limit=100', '--stack-trace-limit=-=xX_nodejs_Xx=-', - ].concat(process.config.variables.v8_enable_inspector ? [ + ].concat(process.features.inspector ? [ '--inspect-brk', 'inspect-brk', '--inspect_brk', diff --git a/test/parallel/test-process-features.js b/test/parallel/test-process-features.js index 7752cc53b2..a24d366ba8 100644 --- a/test/parallel/test-process-features.js +++ b/test/parallel/test-process-features.js @@ -6,6 +6,7 @@ const assert = require('assert'); const keys = new Set(Object.keys(process.features)); assert.deepStrictEqual(keys, new Set([ + 'inspector', 'debug', 'uv', 'ipv6', diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 69011e4af8..4c68ec2c8f 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -29,7 +29,7 @@ const { } = require('../common/hijackstdio'); const assert = require('assert'); const fixtures = require('../common/fixtures'); -const hasInspector = process.config.variables.v8_enable_inspector === 1; +const hasInspector = process.features.inspector; if (!common.isMainThread) common.skip('process.chdir is not available in Workers'); diff --git a/test/parallel/test-v8-coverage.js b/test/parallel/test-v8-coverage.js index a7a318c34d..3db8b81d55 100644 --- a/test/parallel/test-v8-coverage.js +++ b/test/parallel/test-v8-coverage.js @@ -1,6 +1,6 @@ 'use strict'; -if (!process.config.variables.v8_enable_inspector) return; +if (!process.features.inspector) return; const common = require('../common'); const assert = require('assert'); |