src: remove unused internalBinding('config') properties

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: https://github.com/nodejs/node/pull/25463
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Backport-PR-URL: https://github.com/nodejs/node/pull/26027
This commit is contained in:
Joyee Cheung authored and Michaël Zasso committed 2019-02-10 16:47:14 +01:00
1 parent 756558617e
commit d342707fa7
2 files changed
-34

No files matched your search

-22
View File
@@ -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)));
@@ -1,12 +0,0 @@
'use strict';
// Flags: --expose_internals
require('../common');
const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
const config = internalBinding('config');
console.log(config, process.argv);
assert.strictEqual(typeof require('internal/freelist').FreeList, 'function');
assert.strictEqual(config.exposeInternals, true);