From 9ccf7dbe2dee4cbfd9057a124c6d30aed0c3a8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 6 Dec 2020 10:07:47 +0100 Subject: [PATCH] build,lib,test: change whitelist to allowlist PR-URL: https://github.com/nodejs/node/pull/36406 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- configure.py | 2 +- lib/internal/bootstrap/loaders.js | 8 ++++---- test/common/README.md | 8 ++++---- test/common/index.js | 4 ++-- ... => test-process-binding-internalbinding-allowlist.js} | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename test/parallel/{test-process-binding-internalbinding-whitelist.js => test-process-binding-internalbinding-allowlist.js} (94%) diff --git a/configure.py b/configure.py index e6f7e4db0040dd..c0e72538971724 100755 --- a/configure.py +++ b/configure.py @@ -857,7 +857,7 @@ def get_gas_version(cc): # 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 -# 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. def check_compiler(o): if sys.platform == 'win32': diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index d939c2911d0df3..cae3200e677926 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -69,11 +69,11 @@ ObjectDefineProperty(process, 'moduleLoadList', { }); -// internalBindingWhitelist contains the name of internalBinding modules -// that are whitelisted for access via process.binding()... This is used +// internalBindingAllowlist contains the name of internalBinding modules +// that are allowed for access via process.binding()... This is used // to provide a transition path for modules that are being moved over to // internalBinding. -const internalBindingWhitelist = new SafeSet([ +const internalBindingAllowlist = new SafeSet([ 'async_wrap', 'buffer', 'cares_wrap', @@ -113,7 +113,7 @@ const internalBindingWhitelist = new SafeSet([ module = String(module); // Deprecated specific process.binding() modules, but not all, allow // selective fallback to internalBinding for the deprecated ones. - if (internalBindingWhitelist.has(module)) { + if (internalBindingAllowlist.has(module)) { return internalBinding(module); } // eslint-disable-next-line no-restricted-syntax diff --git a/test/common/README.md b/test/common/README.md index 07bc3e180df3f2..a71b37ee935740 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -39,12 +39,12 @@ The `benchmark` module is used by tests to run benchmarks. The `common` module is used by tests for consistency across repeated tasks. -### `allowGlobals(...whitelist)` +### `allowGlobals(...allowlist)` -* `whitelist` [<Array>][] Array of Globals +* `allowlist` [<Array>][] Array of Globals * return [<Array>][] -Takes `whitelist` and concats that with predefined `knownGlobals`. +Takes `allowlist` and concats that with predefined `knownGlobals`. ### `canCreateSymLink()` @@ -600,7 +600,7 @@ If set, crypto tests are skipped. ### `NODE_TEST_KNOWN_GLOBALS` 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. ## Fixtures Module diff --git a/test/common/index.js b/test/common/index.js index 95ffa28a2cc3d4..4c7a403d86acd9 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -275,8 +275,8 @@ if (global.gc) { knownGlobals.push(global.gc); } -function allowGlobals(...whitelist) { - knownGlobals = knownGlobals.concat(whitelist); +function allowGlobals(...allowlist) { + knownGlobals = knownGlobals.concat(allowlist); } if (process.env.NODE_TEST_KNOWN_GLOBALS !== '0') { diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-allowlist.js similarity index 94% rename from test/parallel/test-process-binding-internalbinding-whitelist.js rename to test/parallel/test-process-binding-internalbinding-allowlist.js index 9768ef66741aa3..10667b843cde88 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-allowlist.js @@ -4,7 +4,7 @@ const common = require('../common'); const assert = require('assert'); -// Assert that whitelisted internalBinding modules are accessible via +// Assert that allowed internalBinding modules are accessible via // process.binding(). assert(process.binding('async_wrap')); assert(process.binding('buffer'));