Skip to content

Commit ebdcf91

Browse files
joyeecheungtargos
authored andcommitted
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 ``` Backport-PR-URL: #19374 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 ff7a116 commit ebdcf91

25 files changed

+76
-73
lines changed

β€Žlib/domain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const util = require('util');
3030
const EventEmitter = require('events');
3131
const errors = require('internal/errors');
3232
const { createHook } = require('async_hooks');
33-
const { internalBinding } = require('internal/bootstrap_loaders');
33+
const { internalBinding } = require('internal/bootstrap/loaders');
3434

3535
// overwrite process.domain with a getter/setter that will allow for more
3636
// 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;
@@ -211,6 +211,6 @@
211211
};
212212

213213
// This will be passed to the bootstrapNodeJSCore function in
214-
// bootstrap_node.js.
214+
// bootstrap/node.js.
215215
return loaderExports;
216216
});

β€Ž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/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');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
// exposes ModuleWrap for testing
44

5-
const { internalBinding } = require('internal/bootstrap_loaders');
5+
const { internalBinding } = require('internal/bootstrap/loaders');
66
module.exports = internalBinding('module_wrap').ModuleWrap;

β€Žlib/internal/loader/Translators.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 { NativeModule, internalBinding } = require('internal/bootstrap_loaders');
3+
const { NativeModule, internalBinding } = require('internal/bootstrap/loaders');
44
const { ModuleWrap } = internalBinding('module_wrap');
55
const internalCJSModule = require('internal/module');
66
const CJSModule = require('module');

β€Žlib/internal/process/modules.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 {
55
setImportModuleDynamicallyCallback
66
} = internalBinding('module_wrap');

β€Žlib/internal/vm/Module.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 { emitExperimentalWarning } = require('internal/util');
55
const { URL } = require('internal/url');
66
const { kParsingContext, isContext } = process.binding('contextify');

0 commit comments

Comments
Β (0)