diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-12-26 14:53:36 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2019-01-04 20:25:31 +0300 |
commit | b22c86ed3bd3242177b02a34292febe41275a52b (patch) | |
tree | e45fe8e41e4f8fbd20c2dbfffc8c9836ffac815b /src/node_config.cc | |
parent | d4934ae6f2745f8fab1a83821f50290c9688c326 (diff) |
src: use `internalBinding('config').hasInspector` in JS land
Instead of `process.config.variables.v8_enable_inspector`
which depends on the variable name in gyp files, or detecting
`internalBinding('inspector').Connection`.
PR-URL: https://github.com/nodejs/node/pull/25291
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_config.cc')
-rw-r--r-- | src/node_config.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_config.cc b/src/node_config.cc index 7204e246562..8756969cda2 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -57,6 +57,12 @@ static void Initialize(Local<Object> target, READONLY_TRUE_PROPERTY(target, "hasTracing"); #endif +#if HAVE_INSPECTOR + READONLY_TRUE_PROPERTY(target, "hasInspector"); +#else + READONLY_FALSE_PROPERTY(target, "hasInspector"); +#endif + #if !defined(NODE_WITHOUT_NODE_OPTIONS) READONLY_TRUE_PROPERTY(target, "hasNodeOptions"); #endif |