Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7480864

Browse filesBrowse files
Masashi Hiranoaddaleax
authored andcommitted
src,lib: make process.binding('config') internal
PR-URL: #23400 Refs: #22160 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Backport-PR-URL: #25446 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 87a58be commit 7480864
Copy full SHA for 7480864

File tree

Expand file treeCollapse file tree

15 files changed

+24
-17
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

15 files changed

+24
-17
lines changed
Open diff view settings
Collapse file

‎lib/buffer.js‎

Copy file name to clipboardExpand all lines: lib/buffer.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const {
5757
} = require('internal/util/types');
5858
const {
5959
pendingDeprecation
60-
} = process.binding('config');
60+
} = internalBinding('config');
6161
const {
6262
formatProperty,
6363
kObjectType
@@ -1083,7 +1083,7 @@ Buffer.prototype.swap64 = function swap64() {
10831083
Buffer.prototype.toLocaleString = Buffer.prototype.toString;
10841084

10851085
let transcode;
1086-
if (process.binding('config').hasIntl) {
1086+
if (internalBinding('config').hasIntl) {
10871087
const {
10881088
icuErrName,
10891089
transcode: _transcode
Collapse file

‎lib/crypto.js‎

Copy file name to clipboardExpand all lines: lib/crypto.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const pendingDeprecation = getOptionValue('--pending-deprecation');
4040
const {
4141
fipsMode,
4242
fipsForced
43-
} = process.binding('config');
43+
} = internalBinding('config');
4444
const { getFipsCrypto, setFipsCrypto } = internalBinding('crypto');
4545
const {
4646
randomBytes,
Collapse file

‎lib/internal/async_hooks.js‎

Copy file name to clipboardExpand all lines: lib/internal/async_hooks.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function fatalError(e) {
107107
Error.captureStackTrace(o, fatalError);
108108
process._rawDebug(o.stack);
109109
}
110-
if (process.binding('config').shouldAbortOnUncaughtException) {
110+
if (internalBinding('config').shouldAbortOnUncaughtException) {
111111
process.abort();
112112
}
113113
process.exit(1);
Collapse file

‎lib/internal/bootstrap/loaders.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ ObjectDefineProperty(process, 'moduleLoadList', {
7373
writable: false
7474
});
7575

76+
7677
// internalBindingWhitelist contains the name of internalBinding modules
7778
// that are whitelisted for access via process.binding()... This is used
7879
// to provide a transition path for modules that are being moved over to
@@ -81,6 +82,7 @@ const internalBindingWhitelist = [
8182
'async_wrap',
8283
'buffer',
8384
'cares_wrap',
85+
'config',
8486
'constants',
8587
'contextify',
8688
'crypto',
@@ -168,7 +170,7 @@ function NativeModule(id) {
168170
NativeModule._source = getInternalBinding('natives');
169171
NativeModule._cache = {};
170172

171-
const config = getBinding('config');
173+
const config = getInternalBinding('config');
172174

173175
// Think of this as module.exports in this file even though it is not
174176
// written in CommonJS style.
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function startup() {
176176
{
177177
// Install legacy getters on the `util` binding for typechecking.
178178
// TODO(addaleax): Turn into a full runtime deprecation.
179-
const { pendingDeprecation } = process.binding('config');
179+
const { pendingDeprecation } = internalBinding('config');
180180
const utilBinding = internalBinding('util');
181181
const types = internalBinding('types');
182182
for (const name of [
@@ -638,7 +638,7 @@ function setupProcessFatal() {
638638
}
639639

640640
function setupProcessICUVersions() {
641-
const icu = process.binding('config').hasIntl ?
641+
const icu = internalBinding('config').hasIntl ?
642642
internalBinding('icu') : undefined;
643643
if (!icu) return; // no Intl/ICU: nothing to add here.
644644
// With no argument, getVersion() returns a comma separated list
Collapse file

‎lib/internal/encoding.js‎

Copy file name to clipboardExpand all lines: lib/internal/encoding.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ Object.defineProperties(
342342
} });
343343

344344
const TextDecoder =
345-
process.binding('config').hasIntl ?
345+
internalBinding('config').hasIntl ?
346346
makeTextDecoderICU() :
347347
makeTextDecoderJS();
348348

Collapse file

‎lib/internal/inspector_async_hook.js‎

Copy file name to clipboardExpand all lines: lib/internal/inspector_async_hook.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let config;
1212

1313
function lazyHookCreation() {
1414
const { createHook } = require('async_hooks');
15-
config = process.binding('config');
15+
config = internalBinding('config');
1616

1717
hook = createHook({
1818
init(asyncId, type, triggerAsyncId, resource) {
Collapse file

‎lib/internal/print_help.js‎

Copy file name to clipboardExpand all lines: lib/internal/print_help.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for (const key of Object.keys(types))
99

1010
// Environment variables are parsed ad-hoc throughout the code base,
1111
// so we gather the documentation here.
12-
const { hasIntl, hasSmallICU, hasNodeOptions } = process.binding('config');
12+
const { hasIntl, hasSmallICU, hasNodeOptions } = internalBinding('config');
1313
const envVars = new Map([
1414
['NODE_DEBUG', { helpText: "','-separated list of core modules that " +
1515
'should print debug information' }],
Collapse file

‎lib/internal/readline.js‎

Copy file name to clipboardExpand all lines: lib/internal/readline.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CSI.kClearToEnd = CSI`0K`;
3030
CSI.kClearLine = CSI`2K`;
3131
CSI.kClearScreenDown = CSI`0J`;
3232

33-
if (process.binding('config').hasIntl) {
33+
if (internalBinding('config').hasIntl) {
3434
const icu = internalBinding('icu');
3535
getStringWidth = function getStringWidth(str, options) {
3636
options = options || {};
Collapse file

‎lib/trace_events.js‎

Copy file name to clipboardExpand all lines: lib/trace_events.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { hasTracing } = process.binding('config');
3+
const { hasTracing } = internalBinding('config');
44
const kHandle = Symbol('handle');
55
const kEnabled = Symbol('enabled');
66
const kCategories = Symbol('categories');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.