Skip to content

Commit 577da83

Browse files
joyeecheungaddaleax
authored andcommitted
Revert "src,lib: make process.binding('config') internal"
This reverts commit 88a5449. PR-URL: #25446 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 42a7eaf commit 577da83

15 files changed

Lines changed: 17 additions & 23 deletions

‎lib/buffer.js‎

Lines 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-
}=internalBinding('config');
60+
}=process.binding('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
lettranscode;
1086-
if(internalBinding('config').hasIntl){
1086+
if(process.binding('config').hasIntl){
10871087
const{
10881088
icuErrName,
10891089
transcode: _transcode

‎lib/crypto.js‎

Lines 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-
}=internalBinding('config');
43+
}=process.binding('config');
4444
const{ getFipsCrypto, setFipsCrypto }=internalBinding('crypto');
4545
const{
4646
randomBytes,

‎lib/internal/async_hooks.js‎

Lines 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(internalBinding('config').shouldAbortOnUncaughtException){
110+
if(process.binding('config').shouldAbortOnUncaughtException){
111111
process.abort();
112112
}
113113
process.exit(1);

‎lib/internal/bootstrap/loaders.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
'buffer',
8080
'cares_wrap',
8181
'constants',
82-
'config',
8382
'contextify',
8483
'crypto',
8584
'fs_event_wrap',
@@ -165,7 +164,7 @@
165164
NativeModule._source=getInternalBinding('natives');
166165
NativeModule._cache={};
167166

168-
constconfig=getInternalBinding('config');
167+
constconfig=getBinding('config');
169168

170169
// Think of this as module.exports in this file even though it is not
171170
// written in CommonJS style.

‎lib/internal/bootstrap/node.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
{
176176
// Install legacy getters on the `util` binding for typechecking.
177177
// TODO(addaleax): Turn into a full runtime deprecation.
178-
const{ pendingDeprecation }=internalBinding('config');
178+
const{ pendingDeprecation }=process.binding('config');
179179
constutilBinding=internalBinding('util');
180180
consttypes=internalBinding('types');
181181
for(constnameof[
@@ -637,7 +637,7 @@
637637
}
638638

639639
functionsetupProcessICUVersions(){
640-
consticu=internalBinding('config').hasIntl ?
640+
consticu=process.binding('config').hasIntl ?
641641
internalBinding('icu') : undefined;
642642
if(!icu)return;// no Intl/ICU: nothing to add here.
643643
// With no argument, getVersion() returns a comma separated list

‎lib/internal/encoding.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ Object.defineProperties(
342342
}});
343343

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

‎lib/internal/inspector_async_hook.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let config;
1212

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

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

‎lib/internal/print_help.js‎

Lines 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 }=internalBinding('config');
12+
const{ hasIntl, hasSmallICU, hasNodeOptions }=process.binding('config');
1313
constenvVars=newMap([
1414
['NODE_DEBUG',{helpText: "','-separated list of core modules that "+
1515
'should print debug information'}],

‎lib/internal/readline.js‎

Lines 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(internalBinding('config').hasIntl){
33+
if(process.binding('config').hasIntl){
3434
consticu=internalBinding('icu');
3535
getStringWidth=functiongetStringWidth(str,options){
3636
options=options||{};

‎lib/trace_events.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

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

0 commit comments

Comments
 (0)