Revert "src,lib: make process.binding('config') internal"

This reverts commit 88a54497e5.

PR-URL: https://github.com/nodejs/node/pull/25446
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Joyee Cheung authored and Anna Henningsen committed 2019-01-14 13:58:07 +01:00
1 parent 42a7eaf9d4
commit 577da835d2
15 files changed
+17 -23

No files matched your search

+2 -2
View File
@@ -57,7 +57,7 @@ const {
} = require('internal/util/types');
const {
pendingDeprecation
} = internalBinding('config');
} = process.binding('config');
const {
formatProperty,
kObjectType
@@ -1083,7 +1083,7 @@ Buffer.prototype.swap64 = function swap64() {
Buffer.prototype.toLocaleString = Buffer.prototype.toString;
let transcode;
if (internalBinding('config').hasIntl) {
if (process.binding('config').hasIntl) {
const {
icuErrName,
transcode: _transcode
+1 -1
View File
@@ -40,7 +40,7 @@ const pendingDeprecation = getOptionValue('--pending-deprecation');
const {
fipsMode,
fipsForced
} = internalBinding('config');
} = process.binding('config');
const { getFipsCrypto, setFipsCrypto } = internalBinding('crypto');
const {
randomBytes,
+1 -1
View File
@@ -107,7 +107,7 @@ function fatalError(e) {
Error.captureStackTrace(o, fatalError);
process._rawDebug(o.stack);
}
if (internalBinding('config').shouldAbortOnUncaughtException) {
if (process.binding('config').shouldAbortOnUncaughtException) {
process.abort();
}
process.exit(1);
+1 -2
View File
@@ -79,7 +79,6 @@
'buffer',
'cares_wrap',
'constants',
'config',
'contextify',
'crypto',
'fs_event_wrap',
@@ -165,7 +164,7 @@
NativeModule._source = getInternalBinding('natives');
NativeModule._cache = {};
const config = getInternalBinding('config');
const config = getBinding('config');
// Think of this as module.exports in this file even though it is not
// written in CommonJS style.
+2 -2
View File
@@ -175,7 +175,7 @@
{
// Install legacy getters on the `util` binding for typechecking.
// TODO(addaleax): Turn into a full runtime deprecation.
const { pendingDeprecation } = internalBinding('config');
const { pendingDeprecation } = process.binding('config');
const utilBinding = internalBinding('util');
const types = internalBinding('types');
for (const name of [
@@ -637,7 +637,7 @@
}
function setupProcessICUVersions() {
const icu = internalBinding('config').hasIntl ?
const icu = process.binding('config').hasIntl ?
internalBinding('icu') : undefined;
if (!icu) return; // no Intl/ICU: nothing to add here.
// With no argument, getVersion() returns a comma separated list
+1 -1
View File
@@ -342,7 +342,7 @@ Object.defineProperties(
} });
const TextDecoder =
internalBinding('config').hasIntl ?
process.binding('config').hasIntl ?
makeTextDecoderICU() :
makeTextDecoderJS();
+1 -1
View File
@@ -12,7 +12,7 @@ let config;
function lazyHookCreation() {
const { createHook } = require('async_hooks');
config = internalBinding('config');
config = process.binding('config');
hook = createHook({
init(asyncId, type, triggerAsyncId, resource) {
+1 -1
View File
@@ -9,7 +9,7 @@ for (const key of Object.keys(types))
// Environment variables are parsed ad-hoc throughout the code base,
// so we gather the documentation here.
const { hasIntl, hasSmallICU, hasNodeOptions } = internalBinding('config');
const { hasIntl, hasSmallICU, hasNodeOptions } = process.binding('config');
const envVars = new Map([
['NODE_DEBUG', { helpText: "','-separated list of core modules that " +
'should print debug information' }],
+1 -1
View File
@@ -30,7 +30,7 @@ CSI.kClearToEnd = CSI`0K`;
CSI.kClearLine = CSI`2K`;
CSI.kClearScreenDown = CSI`0J`;
if (internalBinding('config').hasIntl) {
if (process.binding('config').hasIntl) {
const icu = internalBinding('icu');
getStringWidth = function getStringWidth(str, options) {
options = options || {};
+1 -1
View File
@@ -1,6 +1,6 @@
'use strict';
const { hasTracing } = internalBinding('config');
const { hasTracing } = process.binding('config');
const kHandle = Symbol('handle');
const kEnabled = Symbol('enabled');
const kCategories = Symbol('categories');
+1 -1
View File
@@ -21,7 +21,7 @@
'use strict';
const { toASCII } = internalBinding('config').hasIntl ?
const { toASCII } = process.binding('config').hasIntl ?
internalBinding('icu') : require('punycode');
const { hexTable } = require('internal/querystring');
+1 -1
View File
@@ -106,4 +106,4 @@ static void Initialize(Local<Object> target,
} // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(config, node::Initialize)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(config, node::Initialize)
+1 -3
View File
@@ -1,10 +1,8 @@
// Flags: --expose-internals
'use strict';
const { internalBinding } = require('internal/test/binding');
const common = require('../common');
const os = require('os');
const { hasSmallICU } = internalBinding('config');
const { hasSmallICU } = process.binding('config');
if (!(common.hasIntl && hasSmallICU))
common.skip('missing Intl');
@@ -3,8 +3,7 @@
require('../common');
const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
const config = internalBinding('config');
const config = process.binding('config');
console.log(config, process.argv);
+1 -3
View File
@@ -1,6 +1,4 @@
// Flags: --expose-internals
'use strict';
const { internalBinding } = require('internal/test/binding');
require('../common');
const { PassThrough } = require('stream');
const readline = require('readline');
@@ -25,7 +23,7 @@ const ctrlU = { ctrl: true, name: 'u' };
// The non-ICU JS implementation of character width calculation is only aware
// of the wide/narrow distinction. Only test these more advanced cases when
// ICU is available.
if (internalBinding('config').hasIntl) {
if (process.binding('config').hasIntl) {
tests.push(
[0, '\u0301'], // COMBINING ACUTE ACCENT
[1, 'a\u0301'], // á