diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2017-04-05 14:06:52 -0700 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2017-04-13 07:09:39 -0700 |
commit | 8086cb68aefc2f8bfeba412a8706f68cdf3a0b13 (patch) | |
tree | f6bb59176bfaaa373e555d991aea488b8dd4bb51 /lib | |
parent | e505c079e0ff169138d603bf7fa56da937274bbf (diff) | |
download | android-node-v8-8086cb68aefc2f8bfeba412a8706f68cdf3a0b13.tar.gz android-node-v8-8086cb68aefc2f8bfeba412a8706f68cdf3a0b13.tar.bz2 android-node-v8-8086cb68aefc2f8bfeba412a8706f68cdf3a0b13.zip |
src: use option parser for expose_internals
bootstrap_node.js was directly parsing process.execArgv to see if
internals should be exposed, even though the argv was already parsed by
node. This is unusual and unnecessary, change it to set the option value
from the parser onto the config binding.
PR-URL: https://github.com/nodejs/node/pull/12245
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/bootstrap_node.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index cb68671258..6380506b72 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -510,11 +510,9 @@ return NativeModule._source.hasOwnProperty(id); }; - const EXPOSE_INTERNALS = process.execArgv.some(function(arg) { - return arg.match(/^--expose[-_]internals$/); - }); + const config = process.binding('config'); - if (EXPOSE_INTERNALS) { + if (config.exposeInternals) { NativeModule.nonInternalExists = NativeModule.exists; NativeModule.isInternal = function(id) { |