| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 87a58be commit 7480864
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,7 +57,7 @@ const { | |||
| 57 | 57 | } = require('internal/util/types'); | |
| 58 | 58 | const { | |
| 59 | 59 | pendingDeprecation | |
| 60 | - } = process.binding('config'); | ||
| 60 | + } = internalBinding('config'); | ||
| 61 | 61 | const { | |
| 62 | 62 | formatProperty, | |
| 63 | 63 | kObjectType | |
@@ -1083,7 +1083,7 @@ Buffer.prototype.swap64 = function swap64() { | |||
| 1083 | 1083 | Buffer.prototype.toLocaleString = Buffer.prototype.toString; | |
| 1084 | 1084 | ||
| 1085 | 1085 | let transcode; | |
| 1086 | - if (process.binding('config').hasIntl) { | ||
| 1086 | + if (internalBinding('config').hasIntl) { | ||
| 1087 | 1087 | const { | |
| 1088 | 1088 | icuErrName, | |
| 1089 | 1089 | transcode: _transcode | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ const pendingDeprecation = getOptionValue('--pending-deprecation'); | |||
| 40 | 40 | const { | |
| 41 | 41 | fipsMode, | |
| 42 | 42 | fipsForced | |
| 43 | - } = process.binding('config'); | ||
| 43 | + } = internalBinding('config'); | ||
| 44 | 44 | const { getFipsCrypto, setFipsCrypto } = internalBinding('crypto'); | |
| 45 | 45 | const { | |
| 46 | 46 | randomBytes, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,7 +107,7 @@ function fatalError(e) { | |||
| 107 | 107 | Error.captureStackTrace(o, fatalError); | |
| 108 | 108 | process._rawDebug(o.stack); | |
| 109 | 109 | } | |
| 110 | - if (process.binding('config').shouldAbortOnUncaughtException) { | ||
| 110 | + if (internalBinding('config').shouldAbortOnUncaughtException) { | ||
| 111 | 111 | process.abort(); | |
| 112 | 112 | } | |
| 113 | 113 | process.exit(1); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,6 +73,7 @@ ObjectDefineProperty(process, 'moduleLoadList', { | |||
| 73 | 73 | writable: false | |
| 74 | 74 | }); | |
| 75 | 75 | ||
| 76 | + | ||
| 76 | 77 | // internalBindingWhitelist contains the name of internalBinding modules | |
| 77 | 78 | // that are whitelisted for access via process.binding()... This is used | |
| 78 | 79 | // to provide a transition path for modules that are being moved over to | |
@@ -81,6 +82,7 @@ const internalBindingWhitelist = [ | |||
| 81 | 82 | 'async_wrap', | |
| 82 | 83 | 'buffer', | |
| 83 | 84 | 'cares_wrap', | |
| 85 | + 'config', | ||
| 84 | 86 | 'constants', | |
| 85 | 87 | 'contextify', | |
| 86 | 88 | 'crypto', | |
@@ -168,7 +170,7 @@ function NativeModule(id) { | |||
| 168 | 170 | NativeModule._source = getInternalBinding('natives'); | |
| 169 | 171 | NativeModule._cache = {}; | |
| 170 | 172 | ||
| 171 | - const config = getBinding('config'); | ||
| 173 | + const config = getInternalBinding('config'); | ||
| 172 | 174 | ||
| 173 | 175 | // Think of this as module.exports in this file even though it is not | |
| 174 | 176 | // written in CommonJS style. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,7 +176,7 @@ function startup() { | |||
| 176 | 176 | { | |
| 177 | 177 | // Install legacy getters on the `util` binding for typechecking. | |
| 178 | 178 | // TODO(addaleax): Turn into a full runtime deprecation. | |
| 179 | - const { pendingDeprecation } = process.binding('config'); | ||
| 179 | + const { pendingDeprecation } = internalBinding('config'); | ||
| 180 | 180 | const utilBinding = internalBinding('util'); | |
| 181 | 181 | const types = internalBinding('types'); | |
| 182 | 182 | for (const name of [ | |
@@ -638,7 +638,7 @@ function setupProcessFatal() { | |||
| 638 | 638 | } | |
| 639 | 639 | ||
| 640 | 640 | function setupProcessICUVersions() { | |
| 641 | - const icu = process.binding('config').hasIntl ? | ||
| 641 | + const icu = internalBinding('config').hasIntl ? | ||
| 642 | 642 | internalBinding('icu') : undefined; | |
| 643 | 643 | if (!icu) return; // no Intl/ICU: nothing to add here. | |
| 644 | 644 | // With no argument, getVersion() returns a comma separated list | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -342,7 +342,7 @@ Object.defineProperties( | |||
| 342 | 342 | } }); | |
| 343 | 343 | ||
| 344 | 344 | const TextDecoder = | |
| 345 | - process.binding('config').hasIntl ? | ||
| 345 | + internalBinding('config').hasIntl ? | ||
| 346 | 346 | makeTextDecoderICU() : | |
| 347 | 347 | makeTextDecoderJS(); | |
| 348 | 348 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ let config; | |||
| 12 | 12 | ||
| 13 | 13 | function lazyHookCreation() { | |
| 14 | 14 | const { createHook } = require('async_hooks'); | |
| 15 | - config = process.binding('config'); | ||
| 15 | + config = internalBinding('config'); | ||
| 16 | 16 | ||
| 17 | 17 | hook = createHook({ | |
| 18 | 18 | init(asyncId, type, triggerAsyncId, resource) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ for (const key of Object.keys(types)) | |||
| 9 | 9 | ||
| 10 | 10 | // Environment variables are parsed ad-hoc throughout the code base, | |
| 11 | 11 | // so we gather the documentation here. | |
| 12 | - const { hasIntl, hasSmallICU, hasNodeOptions } = process.binding('config'); | ||
| 12 | + const { hasIntl, hasSmallICU, hasNodeOptions } = internalBinding('config'); | ||
| 13 | 13 | const envVars = new Map([ | |
| 14 | 14 | ['NODE_DEBUG', { helpText: "','-separated list of core modules that " + | |
| 15 | 15 | 'should print debug information' }], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ CSI.kClearToEnd = CSI`0K`; | |||
| 30 | 30 | CSI.kClearLine = CSI`2K`; | |
| 31 | 31 | CSI.kClearScreenDown = CSI`0J`; | |
| 32 | 32 | ||
| 33 | - if (process.binding('config').hasIntl) { | ||
| 33 | + if (internalBinding('config').hasIntl) { | ||
| 34 | 34 | const icu = internalBinding('icu'); | |
| 35 | 35 | getStringWidth = function getStringWidth(str, options) { | |
| 36 | 36 | options = options || {}; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - const { hasTracing } = process.binding('config'); | ||
| 3 | + const { hasTracing } = internalBinding('config'); | ||
| 4 | 4 | const kHandle = Symbol('handle'); | |
| 5 | 5 | const kEnabled = Symbol('enabled'); | |
| 6 | 6 | const kCategories = Symbol('categories'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments