build,lib,test: change whitelist to allowlist
PR-URL: https://github.com/nodejs/node/pull/36406 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
parent
72b07e4fcf
commit
7e5bf48998
@ -948,7 +948,7 @@ def get_gas_version(cc):
|
|||||||
|
|
||||||
# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes
|
# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes
|
||||||
# the version check more by accident than anything else but a more rigorous
|
# the version check more by accident than anything else but a more rigorous
|
||||||
# check involves checking the build number against a whitelist. I'm not
|
# check involves checking the build number against an allowlist. I'm not
|
||||||
# quite prepared to go that far yet.
|
# quite prepared to go that far yet.
|
||||||
def check_compiler(o):
|
def check_compiler(o):
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
|
@ -69,11 +69,11 @@ ObjectDefineProperty(process, 'moduleLoadList', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// internalBindingWhitelist contains the name of internalBinding modules
|
// internalBindingAllowlist contains the name of internalBinding modules
|
||||||
// that are whitelisted for access via process.binding()... This is used
|
// that are allowed for access via process.binding()... This is used
|
||||||
// to provide a transition path for modules that are being moved over to
|
// to provide a transition path for modules that are being moved over to
|
||||||
// internalBinding.
|
// internalBinding.
|
||||||
const internalBindingWhitelist = new SafeSet([
|
const internalBindingAllowlist = new SafeSet([
|
||||||
'async_wrap',
|
'async_wrap',
|
||||||
'buffer',
|
'buffer',
|
||||||
'cares_wrap',
|
'cares_wrap',
|
||||||
@ -113,7 +113,7 @@ const internalBindingWhitelist = new SafeSet([
|
|||||||
module = String(module);
|
module = String(module);
|
||||||
// Deprecated specific process.binding() modules, but not all, allow
|
// Deprecated specific process.binding() modules, but not all, allow
|
||||||
// selective fallback to internalBinding for the deprecated ones.
|
// selective fallback to internalBinding for the deprecated ones.
|
||||||
if (internalBindingWhitelist.has(module)) {
|
if (internalBindingAllowlist.has(module)) {
|
||||||
return internalBinding(module);
|
return internalBinding(module);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
|
@ -40,12 +40,12 @@ The `benchmark` module is used by tests to run benchmarks.
|
|||||||
The `common` module is used by tests for consistency across repeated
|
The `common` module is used by tests for consistency across repeated
|
||||||
tasks.
|
tasks.
|
||||||
|
|
||||||
### `allowGlobals(...whitelist)`
|
### `allowGlobals(...allowlist)`
|
||||||
|
|
||||||
* `whitelist` [<Array>][] Array of Globals
|
* `allowlist` [<Array>][] Array of Globals
|
||||||
* return [<Array>][]
|
* return [<Array>][]
|
||||||
|
|
||||||
Takes `whitelist` and concats that with predefined `knownGlobals`.
|
Takes `allowlist` and concats that with predefined `knownGlobals`.
|
||||||
|
|
||||||
### `canCreateSymLink()`
|
### `canCreateSymLink()`
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ If set, crypto tests are skipped.
|
|||||||
### `NODE_TEST_KNOWN_GLOBALS`
|
### `NODE_TEST_KNOWN_GLOBALS`
|
||||||
|
|
||||||
A comma-separated list of variables names that are appended to the global
|
A comma-separated list of variables names that are appended to the global
|
||||||
variable whitelist. Alternatively, if `NODE_TEST_KNOWN_GLOBALS` is set to `'0'`,
|
variable allowlist. Alternatively, if `NODE_TEST_KNOWN_GLOBALS` is set to `'0'`,
|
||||||
global leak detection is disabled.
|
global leak detection is disabled.
|
||||||
|
|
||||||
## Fixtures Module
|
## Fixtures Module
|
||||||
|
@ -276,8 +276,8 @@ if (global.gc) {
|
|||||||
knownGlobals.push(global.gc);
|
knownGlobals.push(global.gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowGlobals(...whitelist) {
|
function allowGlobals(...allowlist) {
|
||||||
knownGlobals = knownGlobals.concat(whitelist);
|
knownGlobals = knownGlobals.concat(allowlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.NODE_TEST_KNOWN_GLOBALS !== '0') {
|
if (process.env.NODE_TEST_KNOWN_GLOBALS !== '0') {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
// Assert that whitelisted internalBinding modules are accessible via
|
// Assert that allowed internalBinding modules are accessible via
|
||||||
// process.binding().
|
// process.binding().
|
||||||
assert(process.binding('async_wrap'));
|
assert(process.binding('async_wrap'));
|
||||||
assert(process.binding('buffer'));
|
assert(process.binding('buffer'));
|
Loading…
x
Reference in New Issue
Block a user