Skip to content

Commit

Permalink
src: remove unused internalBinding('config') properties
Browse files Browse the repository at this point in the history
Remove the following properties:

- `preserveSymlinks`
- `preserveSymlinksMain`
- `experimentalModules`
- `userLoader`
- `experimentalVMModules`
- `experimentalREPLAwait`
- `exposeInternals`

We used to use them to pass cli option values from C++ into
JS, but now the values are obtained in JS land using
`require('internal/options').getOptionValue` instead so they
are unused.

Also removes `test/parallel/test-internal-modules-expose.js`
which tests `--expose-internals`.
We already have hundreds of tests depending on `--expose-internals`,
they are more than enough to test the functionality of the flag.

PR-URL: #25463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Backport-PR-URL: #26027
  • Loading branch information
joyeecheung authored and targos committed Feb 10, 2019
1 parent 7565586 commit d342707
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
22 changes: 0 additions & 22 deletions src/node_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,6 @@ static void Initialize(Local<Object> target,

#endif // NODE_HAVE_I18N_SUPPORT

if (env->options()->preserve_symlinks)
READONLY_TRUE_PROPERTY(target, "preserveSymlinks");
if (env->options()->preserve_symlinks_main)
READONLY_TRUE_PROPERTY(target, "preserveSymlinksMain");

if (env->options()->experimental_modules) {
READONLY_TRUE_PROPERTY(target, "experimentalModules");
const std::string& userland_loader = env->options()->userland_loader;
if (!userland_loader.empty()) {
READONLY_STRING_PROPERTY(target, "userLoader", userland_loader);
}
}

if (env->options()->experimental_vm_modules)
READONLY_TRUE_PROPERTY(target, "experimentalVMModules");

if (env->options()->experimental_repl_await)
READONLY_TRUE_PROPERTY(target, "experimentalREPLAwait");

if (env->options()->expose_internals)
READONLY_TRUE_PROPERTY(target, "exposeInternals");

READONLY_PROPERTY(target,
"bits",
Number::New(env->isolate(), 8 * sizeof(intptr_t)));
Expand Down
12 changes: 0 additions & 12 deletions test/parallel/test-internal-modules-expose.js

This file was deleted.

0 comments on commit d342707

Please sign in to comment.