Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use cli arg instead
  • Loading branch information
vkurchatkin committed Mar 25, 2015
commit b293da97eba9a722409ba79972ac4325b6bccd83
3 changes: 3 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3133,6 +3133,9 @@ static void ParseArgs(int* argc,
} else if (strncmp(arg, "--icu-data-dir=", 15) == 0) {
icu_data_dir = arg + 15;
#endif
} else if (strcmp(arg, "--expose-internals") == 0 ||
strcmp(arg, "--expose_internals") == 0) {
// consumed in js
} else {
// V8 option. Pass through as-is.
new_v8_argv[new_v8_argc] = arg;
Expand Down
6 changes: 5 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,11 @@
return NativeModule._source.hasOwnProperty(id);
};

if (process.env['NODE_EXPOSE_INTERNALS']) {
const EXPOSE_INTERNALS = process.execArgv.some(function(arg) {
return arg.match(/^--expose[-_]internals$/);
});

if (EXPOSE_INTERNALS) {
NativeModule.nonInternalExists = NativeModule.exists;

NativeModule.isInternal = function(id) {
Expand Down