Skip to content

Commit 062f1de

Browse files
committed
bootstrapper: move internalBinding to NativeModule wrapper
internalBinding is used so often that it should just automatically be available for usage in internals. Refs: 2a9eb31
1 parent 9577946 commit 062f1de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+6
-74
lines changed

lib/.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ globals:
4444
DCHECK_LE: false
4545
DCHECK_LT: false
4646
DCHECK_NE: false
47+
internalBinding: false

lib/_http_client.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
const util = require('util');
2525
const net = require('net');
2626
const url = require('url');
27-
const { internalBinding } = require('internal/bootstrap/loaders');
2827
const { HTTPParser } = internalBinding('http_parser');
2928
const assert = require('assert').ok;
3029
const {

lib/_http_common.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
'use strict';
2323

24-
const { internalBinding } = require('internal/bootstrap/loaders');
2524
const { methods, HTTPParser } = internalBinding('http_parser');
2625

2726
const FreeList = require('internal/freelist');

lib/_http_server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
const util = require('util');
2525
const net = require('net');
26-
const { internalBinding } = require('internal/bootstrap/loaders');
2726
const { HTTPParser } = internalBinding('http_parser');
2827
const assert = require('assert').ok;
2928
const {

lib/_tls_common.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const { SSL_OP_CIPHER_SERVER_PREFERENCE } = process.binding('constants').crypto;
3434
// Lazily loaded from internal/crypto/util.
3535
let toBuf = null;
3636

37-
const { internalBinding } = require('internal/bootstrap/loaders');
3837
const { SecureContext: NativeSecureContext } = internalBinding('crypto');
3938
function SecureContext(secureProtocol, secureOptions, context) {
4039
if (!(this instanceof SecureContext)) {

lib/_tls_wrap.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const common = require('_tls_common');
3232
const { StreamWrap } = require('_stream_wrap');
3333
const { Buffer } = require('buffer');
3434
const debug = util.debuglog('tls');
35-
const { internalBinding } = require('internal/bootstrap/loaders');
3635
const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
3736
const tls_wrap = internalBinding('tls_wrap');
3837
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');

lib/buffer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const {
4141
// that test/parallel/test-buffer-bindingobj-no-zerofill.js is written.
4242
let isAnyArrayBuffer;
4343
try {
44-
const { internalBinding } = require('internal/bootstrap/loaders');
4544
isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
4645
} catch (e) {
4746
isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;

lib/child_process.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const {
2828
const { isArrayBufferView } = require('internal/util/types');
2929
const debug = util.debuglog('child_process');
3030
const { Buffer } = require('buffer');
31-
const { internalBinding } = require('internal/bootstrap/loaders');
3231
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
3332
const {
3433
ERR_INVALID_ARG_VALUE,

lib/console.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const {
2929
ERR_INVALID_ARG_VALUE,
3030
},
3131
} = require('internal/errors');
32-
const { internalBinding } = require('internal/bootstrap/loaders');
3332
const { previewEntries } = internalBinding('util');
3433
const { Buffer: { isBuffer } } = require('buffer');
3534
const util = require('util');

lib/crypto.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const {
3030
} = require('internal/util');
3131
assertCrypto();
3232

33-
const { internalBinding } = require('internal/bootstrap/loaders');
3433
const {
3534
ERR_CRYPTO_FIPS_FORCED,
3635
ERR_CRYPTO_FIPS_UNAVAILABLE

0 commit comments

Comments
 (0)