Skip to content

Commit 8484b40

Browse files
committed
src: put bootstrappers in lib/internal/bootstrap/
Create `lib/internal/bootstrap/` and put bootstrappers there: Before: ``` lib/internal β”œβ”€β”€ ... β”œβ”€β”€ bootstrap_loaders.js └── bootstrap_node.js ``` After: ``` lib/internal β”œβ”€β”€ ... └── bootstrap β”œβ”€β”€ loaders.js └── node.js ``` PR-URL: #19177 Refs: #19112 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent d9d0a97 commit 8484b40

32 files changed

+84
-81
lines changed

β€Žlib/assert.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const { openSync, closeSync, readSync } = require('fs');
3636
const { parseExpressionAt } = require('internal/deps/acorn/dist/acorn');
3737
const { inspect } = require('util');
3838
const { EOL } = require('os');
39-
const { NativeModule } = require('internal/bootstrap_loaders');
39+
const { NativeModule } = require('internal/bootstrap/loaders');
4040

4141
// Escape control characters but not \n and \t to keep the line breaks and
4242
// indentation intact.

β€Žlib/buffer.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ 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');
44+
const { internalBinding } = require('internal/bootstrap/loaders');
4545
isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
4646
} catch (e) {
4747
isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;

β€Žlib/domain.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const {
3434
ERR_UNHANDLED_ERROR
3535
} = require('internal/errors').codes;
3636
const { createHook } = require('async_hooks');
37-
const { internalBinding } = require('internal/bootstrap_loaders');
37+
const { internalBinding } = require('internal/bootstrap/loaders');
3838

3939
// overwrite process.domain with a getter/setter that will allow for more
4040
// effective optimizations

β€Žlib/internal/bootstrap_loaders.jsβ€Ž renamed to β€Žlib/internal/bootstrap/loaders.jsβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// modules. In contrast, user land modules are loaded using
33
// lib/module.js (CommonJS Modules) or lib/internal/loader/* (ES Modules).
44
//
5-
// This file is compiled and run by node.cc before bootstrap_node.js
5+
// This file is compiled and run by node.cc before bootstrap/node.js
66
// was called, therefore the loaders are bootstraped before we start to
77
// actually bootstrap Node.js. It creates the following objects:
88
//
@@ -29,7 +29,7 @@
2929
// so they can be loaded faster without the cost of I/O. This class makes the
3030
// lib/internal/*, deps/internal/* modules and internalBinding() available by
3131
// default to core modules, and lets the core modules require itself via
32-
// require('internal/bootstrap_loaders') even when this file is not written in
32+
// require('internal/bootstrap/loaders') even when this file is not written in
3333
// CommonJS style.
3434
//
3535
// Other objects:
@@ -111,7 +111,7 @@
111111
// Think of this as module.exports in this file even though it is not
112112
// written in CommonJS style.
113113
const loaderExports = { internalBinding, NativeModule };
114-
const loaderId = 'internal/bootstrap_loaders';
114+
const loaderId = 'internal/bootstrap/loaders';
115115
NativeModule.require = function(id) {
116116
if (id === loaderId) {
117117
return loaderExports;
@@ -224,6 +224,6 @@
224224
};
225225

226226
// This will be passed to the bootstrapNodeJSCore function in
227-
// bootstrap_node.js.
227+
// bootstrap/node.js.
228228
return loaderExports;
229229
});

β€Žlib/internal/bootstrap_node.jsβ€Ž renamed to β€Žlib/internal/bootstrap/node.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// to the performance of the startup process, many dependencies are invoked
66
// lazily.
77
//
8-
// Before this file is run, lib/internal/bootstrap_loaders.js gets run first
8+
// Before this file is run, lib/internal/bootstrap/loaders.js gets run first
99
// to bootstrap the internal binding and module loaders, including
1010
// process.binding(), process._linkedBinding(), internalBinding() and
1111
// NativeModule. And then { internalBinding, NativeModule } will be passed

β€Žlib/internal/encoding.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const {
2323

2424
const { isArrayBufferView } = require('internal/util/types');
2525

26-
const { internalBinding } = require('internal/bootstrap_loaders');
26+
const { internalBinding } = require('internal/bootstrap/loaders');
2727
const {
2828
isArrayBuffer
2929
} = internalBinding('types');

β€Žlib/internal/http2/core.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require('internal/util').assertCrypto();
66

7-
const { internalBinding } = require('internal/bootstrap_loaders');
7+
const { internalBinding } = require('internal/bootstrap/loaders');
88
const { async_id_symbol } = require('internal/async_hooks').symbols;
99
const { UV_EOF } = process.binding('uv');
1010
const http = require('http');

β€Žlib/internal/loader/CreateDynamicModule.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 { internalBinding } = require('internal/bootstrap_loaders');
3+
const { internalBinding } = require('internal/bootstrap/loaders');
44
const { ModuleWrap } = internalBinding('module_wrap');
55
const debug = require('util').debuglog('esm');
66
const ArrayJoin = Function.call.bind(Array.prototype.join);

β€Žlib/internal/loader/DefaultResolve.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const { URL } = require('url');
44
const CJSmodule = require('module');
55
const internalFS = require('internal/fs');
6-
const { NativeModule, internalBinding } = require('internal/bootstrap_loaders');
6+
const { NativeModule, internalBinding } = require('internal/bootstrap/loaders');
77
const { extname } = require('path');
88
const { realpathSync } = require('fs');
99
const preserveSymlinks = !!process.binding('config').preserveSymlinks;

β€Žlib/internal/loader/ModuleJob.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 { internalBinding } = require('internal/bootstrap_loaders');
3+
const { internalBinding } = require('internal/bootstrap/loaders');
44
const { ModuleWrap } = internalBinding('module_wrap');
55
const { SafeSet, SafePromise } = require('internal/safe_globals');
66
const { decorateErrorStack } = require('internal/util');

0 commit comments

Comments
Β (0)