diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-03-06 22:42:32 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-03-15 20:50:34 +0800 |
commit | 8484b40b3d38e18c524b7dd560c16ab30c94e427 (patch) | |
tree | 1de2db3f46cca74bd7fb2eca5e2a52bd61b2756b /lib | |
parent | d9d0a97541d7a9b478ecc500e5961ad349f42540 (diff) | |
download | android-node-v8-8484b40b3d38e18c524b7dd560c16ab30c94e427.tar.gz android-node-v8-8484b40b3d38e18c524b7dd560c16ab30c94e427.tar.bz2 android-node-v8-8484b40b3d38e18c524b7dd560c16ab30c94e427.zip |
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: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/assert.js | 2 | ||||
-rw-r--r-- | lib/buffer.js | 2 | ||||
-rw-r--r-- | lib/domain.js | 2 | ||||
-rw-r--r-- | lib/internal/bootstrap/loaders.js (renamed from lib/internal/bootstrap_loaders.js) | 8 | ||||
-rw-r--r-- | lib/internal/bootstrap/node.js (renamed from lib/internal/bootstrap_node.js) | 2 | ||||
-rw-r--r-- | lib/internal/encoding.js | 2 | ||||
-rw-r--r-- | lib/internal/http2/core.js | 2 | ||||
-rw-r--r-- | lib/internal/loader/CreateDynamicModule.js | 2 | ||||
-rw-r--r-- | lib/internal/loader/DefaultResolve.js | 2 | ||||
-rw-r--r-- | lib/internal/loader/ModuleJob.js | 2 | ||||
-rw-r--r-- | lib/internal/loader/Translators.js | 2 | ||||
-rw-r--r-- | lib/internal/process/modules.js | 2 | ||||
-rw-r--r-- | lib/internal/test/binding.js | 2 | ||||
-rw-r--r-- | lib/internal/util/comparisons.js | 2 | ||||
-rw-r--r-- | lib/internal/vm/Module.js | 2 | ||||
-rw-r--r-- | lib/module.js | 2 | ||||
-rw-r--r-- | lib/string_decoder.js | 2 | ||||
-rw-r--r-- | lib/util.js | 2 |
18 files changed, 21 insertions, 21 deletions
diff --git a/lib/assert.js b/lib/assert.js index b0d0d9ab4c..797252afc0 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -36,7 +36,7 @@ const { openSync, closeSync, readSync } = require('fs'); const { parseExpressionAt } = require('internal/deps/acorn/dist/acorn'); const { inspect } = require('util'); const { EOL } = require('os'); -const { NativeModule } = require('internal/bootstrap_loaders'); +const { NativeModule } = require('internal/bootstrap/loaders'); // Escape control characters but not \n and \t to keep the line breaks and // indentation intact. diff --git a/lib/buffer.js b/lib/buffer.js index 7703d2a129..b369d27a1e 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -41,7 +41,7 @@ const { // that test/parallel/test-buffer-bindingobj-no-zerofill.js is written. let isAnyArrayBuffer; try { - const { internalBinding } = require('internal/bootstrap_loaders'); + const { internalBinding } = require('internal/bootstrap/loaders'); isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer; } catch (e) { isAnyArrayBuffer = require('util').types.isAnyArrayBuffer; diff --git a/lib/domain.js b/lib/domain.js index e2cc38a1f9..170f291727 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -34,7 +34,7 @@ const { ERR_UNHANDLED_ERROR } = require('internal/errors').codes; const { createHook } = require('async_hooks'); -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); // overwrite process.domain with a getter/setter that will allow for more // effective optimizations diff --git a/lib/internal/bootstrap_loaders.js b/lib/internal/bootstrap/loaders.js index e409438dfc..601c54a0cd 100644 --- a/lib/internal/bootstrap_loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -2,7 +2,7 @@ // modules. In contrast, user land modules are loaded using // lib/module.js (CommonJS Modules) or lib/internal/loader/* (ES Modules). // -// This file is compiled and run by node.cc before bootstrap_node.js +// This file is compiled and run by node.cc before bootstrap/node.js // was called, therefore the loaders are bootstraped before we start to // actually bootstrap Node.js. It creates the following objects: // @@ -29,7 +29,7 @@ // so they can be loaded faster without the cost of I/O. This class makes the // lib/internal/*, deps/internal/* modules and internalBinding() available by // default to core modules, and lets the core modules require itself via -// require('internal/bootstrap_loaders') even when this file is not written in +// require('internal/bootstrap/loaders') even when this file is not written in // CommonJS style. // // Other objects: @@ -111,7 +111,7 @@ // Think of this as module.exports in this file even though it is not // written in CommonJS style. const loaderExports = { internalBinding, NativeModule }; - const loaderId = 'internal/bootstrap_loaders'; + const loaderId = 'internal/bootstrap/loaders'; NativeModule.require = function(id) { if (id === loaderId) { return loaderExports; @@ -224,6 +224,6 @@ }; // This will be passed to the bootstrapNodeJSCore function in - // bootstrap_node.js. + // bootstrap/node.js. return loaderExports; }); diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap/node.js index 6cdbebc0c1..67ec63eb01 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap/node.js @@ -5,7 +5,7 @@ // to the performance of the startup process, many dependencies are invoked // lazily. // -// Before this file is run, lib/internal/bootstrap_loaders.js gets run first +// Before this file is run, lib/internal/bootstrap/loaders.js gets run first // to bootstrap the internal binding and module loaders, including // process.binding(), process._linkedBinding(), internalBinding() and // NativeModule. And then { internalBinding, NativeModule } will be passed diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 1846fc5527..9cd47f861f 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -23,7 +23,7 @@ const { const { isArrayBufferView } = require('internal/util/types'); -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { isArrayBuffer } = internalBinding('types'); diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 7137e527df..9315474364 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -4,7 +4,7 @@ require('internal/util').assertCrypto(); -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { async_id_symbol } = require('internal/async_hooks').symbols; const { UV_EOF } = process.binding('uv'); const http = require('http'); diff --git a/lib/internal/loader/CreateDynamicModule.js b/lib/internal/loader/CreateDynamicModule.js index 8c28917138..7e9777af51 100644 --- a/lib/internal/loader/CreateDynamicModule.js +++ b/lib/internal/loader/CreateDynamicModule.js @@ -1,6 +1,6 @@ 'use strict'; -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { ModuleWrap } = internalBinding('module_wrap'); const debug = require('util').debuglog('esm'); const ArrayJoin = Function.call.bind(Array.prototype.join); diff --git a/lib/internal/loader/DefaultResolve.js b/lib/internal/loader/DefaultResolve.js index f99e0c98b9..a012314d2a 100644 --- a/lib/internal/loader/DefaultResolve.js +++ b/lib/internal/loader/DefaultResolve.js @@ -3,7 +3,7 @@ const { URL } = require('url'); const CJSmodule = require('module'); const internalFS = require('internal/fs'); -const { NativeModule, internalBinding } = require('internal/bootstrap_loaders'); +const { NativeModule, internalBinding } = require('internal/bootstrap/loaders'); const { extname } = require('path'); const { realpathSync } = require('fs'); const preserveSymlinks = !!process.binding('config').preserveSymlinks; diff --git a/lib/internal/loader/ModuleJob.js b/lib/internal/loader/ModuleJob.js index 162b0504d3..d948252829 100644 --- a/lib/internal/loader/ModuleJob.js +++ b/lib/internal/loader/ModuleJob.js @@ -1,6 +1,6 @@ 'use strict'; -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { ModuleWrap } = internalBinding('module_wrap'); const { SafeSet, SafePromise } = require('internal/safe_globals'); const { decorateErrorStack } = require('internal/util'); diff --git a/lib/internal/loader/Translators.js b/lib/internal/loader/Translators.js index 74dd435827..8796b4ddfd 100644 --- a/lib/internal/loader/Translators.js +++ b/lib/internal/loader/Translators.js @@ -1,6 +1,6 @@ 'use strict'; -const { NativeModule, internalBinding } = require('internal/bootstrap_loaders'); +const { NativeModule, internalBinding } = require('internal/bootstrap/loaders'); const { ModuleWrap } = internalBinding('module_wrap'); const internalCJSModule = require('internal/module'); const CJSModule = require('module'); diff --git a/lib/internal/process/modules.js b/lib/internal/process/modules.js index 1592761f54..ca2a9dde5d 100644 --- a/lib/internal/process/modules.js +++ b/lib/internal/process/modules.js @@ -1,6 +1,6 @@ 'use strict'; -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { setImportModuleDynamicallyCallback, setInitializeImportMetaObjectCallback diff --git a/lib/internal/test/binding.js b/lib/internal/test/binding.js index aae89ce7a0..f9f018a782 100644 --- a/lib/internal/test/binding.js +++ b/lib/internal/test/binding.js @@ -8,7 +8,7 @@ process.emitWarning( // These exports should be scoped as specifically as possible // to avoid exposing APIs because even with that warning and // this file being internal people will still try to abuse it. -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); module.exports = { ModuleWrap: internalBinding('module_wrap').ModuleWrap, }; diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index c1c4d7a712..119fb66611 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -2,7 +2,7 @@ const { compare } = process.binding('buffer'); const { isArrayBufferView } = require('internal/util/types'); -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { isDate, isMap, isRegExp, isSet } = internalBinding('types'); function objectToString(o) { diff --git a/lib/internal/vm/Module.js b/lib/internal/vm/Module.js index 6d8f7f76d8..feb4bb190f 100644 --- a/lib/internal/vm/Module.js +++ b/lib/internal/vm/Module.js @@ -1,6 +1,6 @@ 'use strict'; -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { emitExperimentalWarning } = require('internal/util'); const { URL } = require('internal/url'); const { kParsingContext, isContext } = process.binding('contextify'); diff --git a/lib/module.js b/lib/module.js index 6d4e3dbfcf..0b94cb84c6 100644 --- a/lib/module.js +++ b/lib/module.js @@ -21,7 +21,7 @@ 'use strict'; -const { NativeModule } = require('internal/bootstrap_loaders'); +const { NativeModule } = require('internal/bootstrap/loaders'); const util = require('util'); const { decorateErrorStack } = require('internal/util'); const { getURLFromFilePath } = require('internal/url'); diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 4cb50ca97b..a6ae64c062 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -22,7 +22,7 @@ 'use strict'; const { Buffer } = require('buffer'); -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const { kIncompleteCharactersStart, kIncompleteCharactersEnd, diff --git a/lib/util.js b/lib/util.js index 95bf17519b..b64d103cb3 100644 --- a/lib/util.js +++ b/lib/util.js @@ -39,7 +39,7 @@ const { kRejected, } = process.binding('util'); -const { internalBinding } = require('internal/bootstrap_loaders'); +const { internalBinding } = require('internal/bootstrap/loaders'); const types = internalBinding('types'); Object.assign(types, require('internal/util/types')); const { |