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>
This commit is contained in:
parent
d9d0a97541
commit
8484b40b3d
@ -36,7 +36,7 @@ const { openSync, closeSync, readSync } = require('fs');
|
|||||||
const { parseExpressionAt } = require('internal/deps/acorn/dist/acorn');
|
const { parseExpressionAt } = require('internal/deps/acorn/dist/acorn');
|
||||||
const { inspect } = require('util');
|
const { inspect } = require('util');
|
||||||
const { EOL } = require('os');
|
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
|
// Escape control characters but not \n and \t to keep the line breaks and
|
||||||
// indentation intact.
|
// indentation intact.
|
||||||
|
@ -41,7 +41,7 @@ const {
|
|||||||
// that test/parallel/test-buffer-bindingobj-no-zerofill.js is written.
|
// that test/parallel/test-buffer-bindingobj-no-zerofill.js is written.
|
||||||
let isAnyArrayBuffer;
|
let isAnyArrayBuffer;
|
||||||
try {
|
try {
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
|
isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;
|
isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;
|
||||||
|
@ -34,7 +34,7 @@ const {
|
|||||||
ERR_UNHANDLED_ERROR
|
ERR_UNHANDLED_ERROR
|
||||||
} = require('internal/errors').codes;
|
} = require('internal/errors').codes;
|
||||||
const { createHook } = require('async_hooks');
|
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
|
// overwrite process.domain with a getter/setter that will allow for more
|
||||||
// effective optimizations
|
// effective optimizations
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// modules. In contrast, user land modules are loaded using
|
// modules. In contrast, user land modules are loaded using
|
||||||
// lib/module.js (CommonJS Modules) or lib/internal/loader/* (ES Modules).
|
// 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
|
// was called, therefore the loaders are bootstraped before we start to
|
||||||
// actually bootstrap Node.js. It creates the following objects:
|
// 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
|
// 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
|
// lib/internal/*, deps/internal/* modules and internalBinding() available by
|
||||||
// default to core modules, and lets the core modules require itself via
|
// 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.
|
// CommonJS style.
|
||||||
//
|
//
|
||||||
// Other objects:
|
// Other objects:
|
||||||
@ -111,7 +111,7 @@
|
|||||||
// Think of this as module.exports in this file even though it is not
|
// Think of this as module.exports in this file even though it is not
|
||||||
// written in CommonJS style.
|
// written in CommonJS style.
|
||||||
const loaderExports = { internalBinding, NativeModule };
|
const loaderExports = { internalBinding, NativeModule };
|
||||||
const loaderId = 'internal/bootstrap_loaders';
|
const loaderId = 'internal/bootstrap/loaders';
|
||||||
NativeModule.require = function(id) {
|
NativeModule.require = function(id) {
|
||||||
if (id === loaderId) {
|
if (id === loaderId) {
|
||||||
return loaderExports;
|
return loaderExports;
|
||||||
@ -224,6 +224,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// This will be passed to the bootstrapNodeJSCore function in
|
// This will be passed to the bootstrapNodeJSCore function in
|
||||||
// bootstrap_node.js.
|
// bootstrap/node.js.
|
||||||
return loaderExports;
|
return loaderExports;
|
||||||
});
|
});
|
@ -5,7 +5,7 @@
|
|||||||
// to the performance of the startup process, many dependencies are invoked
|
// to the performance of the startup process, many dependencies are invoked
|
||||||
// lazily.
|
// 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
|
// to bootstrap the internal binding and module loaders, including
|
||||||
// process.binding(), process._linkedBinding(), internalBinding() and
|
// process.binding(), process._linkedBinding(), internalBinding() and
|
||||||
// NativeModule. And then { internalBinding, NativeModule } will be passed
|
// NativeModule. And then { internalBinding, NativeModule } will be passed
|
@ -23,7 +23,7 @@ const {
|
|||||||
|
|
||||||
const { isArrayBufferView } = require('internal/util/types');
|
const { isArrayBufferView } = require('internal/util/types');
|
||||||
|
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const {
|
const {
|
||||||
isArrayBuffer
|
isArrayBuffer
|
||||||
} = internalBinding('types');
|
} = internalBinding('types');
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
require('internal/util').assertCrypto();
|
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 { async_id_symbol } = require('internal/async_hooks').symbols;
|
||||||
const { UV_EOF } = process.binding('uv');
|
const { UV_EOF } = process.binding('uv');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const { ModuleWrap } = internalBinding('module_wrap');
|
const { ModuleWrap } = internalBinding('module_wrap');
|
||||||
const debug = require('util').debuglog('esm');
|
const debug = require('util').debuglog('esm');
|
||||||
const ArrayJoin = Function.call.bind(Array.prototype.join);
|
const ArrayJoin = Function.call.bind(Array.prototype.join);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
const { URL } = require('url');
|
const { URL } = require('url');
|
||||||
const CJSmodule = require('module');
|
const CJSmodule = require('module');
|
||||||
const internalFS = require('internal/fs');
|
const internalFS = require('internal/fs');
|
||||||
const { NativeModule, internalBinding } = require('internal/bootstrap_loaders');
|
const { NativeModule, internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const { extname } = require('path');
|
const { extname } = require('path');
|
||||||
const { realpathSync } = require('fs');
|
const { realpathSync } = require('fs');
|
||||||
const preserveSymlinks = !!process.binding('config').preserveSymlinks;
|
const preserveSymlinks = !!process.binding('config').preserveSymlinks;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const { ModuleWrap } = internalBinding('module_wrap');
|
const { ModuleWrap } = internalBinding('module_wrap');
|
||||||
const { SafeSet, SafePromise } = require('internal/safe_globals');
|
const { SafeSet, SafePromise } = require('internal/safe_globals');
|
||||||
const { decorateErrorStack } = require('internal/util');
|
const { decorateErrorStack } = require('internal/util');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { NativeModule, internalBinding } = require('internal/bootstrap_loaders');
|
const { NativeModule, internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const { ModuleWrap } = internalBinding('module_wrap');
|
const { ModuleWrap } = internalBinding('module_wrap');
|
||||||
const internalCJSModule = require('internal/module');
|
const internalCJSModule = require('internal/module');
|
||||||
const CJSModule = require('module');
|
const CJSModule = require('module');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const {
|
const {
|
||||||
setImportModuleDynamicallyCallback,
|
setImportModuleDynamicallyCallback,
|
||||||
setInitializeImportMetaObjectCallback
|
setInitializeImportMetaObjectCallback
|
||||||
|
@ -8,7 +8,7 @@ process.emitWarning(
|
|||||||
// These exports should be scoped as specifically as possible
|
// These exports should be scoped as specifically as possible
|
||||||
// to avoid exposing APIs because even with that warning and
|
// to avoid exposing APIs because even with that warning and
|
||||||
// this file being internal people will still try to abuse it.
|
// 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 = {
|
module.exports = {
|
||||||
ModuleWrap: internalBinding('module_wrap').ModuleWrap,
|
ModuleWrap: internalBinding('module_wrap').ModuleWrap,
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const { compare } = process.binding('buffer');
|
const { compare } = process.binding('buffer');
|
||||||
const { isArrayBufferView } = require('internal/util/types');
|
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');
|
const { isDate, isMap, isRegExp, isSet } = internalBinding('types');
|
||||||
|
|
||||||
function objectToString(o) {
|
function objectToString(o) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const { emitExperimentalWarning } = require('internal/util');
|
const { emitExperimentalWarning } = require('internal/util');
|
||||||
const { URL } = require('internal/url');
|
const { URL } = require('internal/url');
|
||||||
const { kParsingContext, isContext } = process.binding('contextify');
|
const { kParsingContext, isContext } = process.binding('contextify');
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { NativeModule } = require('internal/bootstrap_loaders');
|
const { NativeModule } = require('internal/bootstrap/loaders');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const { decorateErrorStack } = require('internal/util');
|
const { decorateErrorStack } = require('internal/util');
|
||||||
const { getURLFromFilePath } = require('internal/url');
|
const { getURLFromFilePath } = require('internal/url');
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { Buffer } = require('buffer');
|
const { Buffer } = require('buffer');
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const {
|
const {
|
||||||
kIncompleteCharactersStart,
|
kIncompleteCharactersStart,
|
||||||
kIncompleteCharactersEnd,
|
kIncompleteCharactersEnd,
|
||||||
|
@ -39,7 +39,7 @@ const {
|
|||||||
kRejected,
|
kRejected,
|
||||||
} = process.binding('util');
|
} = process.binding('util');
|
||||||
|
|
||||||
const { internalBinding } = require('internal/bootstrap_loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const types = internalBinding('types');
|
const types = internalBinding('types');
|
||||||
Object.assign(types, require('internal/util/types'));
|
Object.assign(types, require('internal/util/types'));
|
||||||
const {
|
const {
|
||||||
|
4
node.gyp
4
node.gyp
@ -24,8 +24,8 @@
|
|||||||
'node_lib_target_name%': 'node_lib',
|
'node_lib_target_name%': 'node_lib',
|
||||||
'node_intermediate_lib_type%': 'static_library',
|
'node_intermediate_lib_type%': 'static_library',
|
||||||
'library_files': [
|
'library_files': [
|
||||||
'lib/internal/bootstrap_loaders.js',
|
'lib/internal/bootstrap/loaders.js',
|
||||||
'lib/internal/bootstrap_node.js',
|
'lib/internal/bootstrap/node.js',
|
||||||
'lib/async_hooks.js',
|
'lib/async_hooks.js',
|
||||||
'lib/assert.js',
|
'lib/assert.js',
|
||||||
'lib/buffer.js',
|
'lib/buffer.js',
|
||||||
|
34
src/node.cc
34
src/node.cc
@ -246,7 +246,7 @@ bool config_experimental_vm_modules = false;
|
|||||||
|
|
||||||
// Set in node.cc by ParseArgs when --loader is used.
|
// Set in node.cc by ParseArgs when --loader is used.
|
||||||
// Used in node_config.cc to set a constant on process.binding('config')
|
// Used in node_config.cc to set a constant on process.binding('config')
|
||||||
// that is used by lib/internal/bootstrap_node.js
|
// that is used by lib/internal/bootstrap/node.js
|
||||||
std::string config_userland_loader; // NOLINT(runtime/string)
|
std::string config_userland_loader; // NOLINT(runtime/string)
|
||||||
|
|
||||||
// Set by ParseArgs when --pending-deprecation or NODE_PENDING_DEPRECATION
|
// Set by ParseArgs when --pending-deprecation or NODE_PENDING_DEPRECATION
|
||||||
@ -259,7 +259,7 @@ std::string config_warning_file; // NOLINT(runtime/string)
|
|||||||
// Set in node.cc by ParseArgs when --expose-internals or --expose_internals is
|
// Set in node.cc by ParseArgs when --expose-internals or --expose_internals is
|
||||||
// used.
|
// used.
|
||||||
// Used in node_config.cc to set a constant on process.binding('config')
|
// Used in node_config.cc to set a constant on process.binding('config')
|
||||||
// that is used by lib/internal/bootstrap_node.js
|
// that is used by lib/internal/bootstrap/node.js
|
||||||
bool config_expose_internals = false;
|
bool config_expose_internals = false;
|
||||||
|
|
||||||
bool v8_initialized = false;
|
bool v8_initialized = false;
|
||||||
@ -3319,23 +3319,23 @@ static Local<Function> GetBootstrapper(Environment* env, Local<String> source,
|
|||||||
// are not safe to ignore.
|
// are not safe to ignore.
|
||||||
try_catch.SetVerbose(false);
|
try_catch.SetVerbose(false);
|
||||||
|
|
||||||
// Execute the factory javascript file
|
// Execute the bootstrapper javascript file
|
||||||
Local<Value> factory_v = ExecuteString(env, source, script_name);
|
Local<Value> bootstrapper_v = ExecuteString(env, source, script_name);
|
||||||
if (try_catch.HasCaught()) {
|
if (try_catch.HasCaught()) {
|
||||||
ReportException(env, try_catch);
|
ReportException(env, try_catch);
|
||||||
exit(10);
|
exit(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(factory_v->IsFunction());
|
CHECK(bootstrapper_v->IsFunction());
|
||||||
Local<Function> factory = Local<Function>::Cast(factory_v);
|
Local<Function> bootstrapper = Local<Function>::Cast(bootstrapper_v);
|
||||||
|
|
||||||
return scope.Escape(factory);
|
return scope.Escape(bootstrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ExecuteBootstrapper(Environment* env, Local<Function> factory,
|
static bool ExecuteBootstrapper(Environment* env, Local<Function> bootstrapper,
|
||||||
int argc, Local<Value> argv[],
|
int argc, Local<Value> argv[],
|
||||||
Local<Value>* out) {
|
Local<Value>* out) {
|
||||||
bool ret = factory->Call(
|
bool ret = bootstrapper->Call(
|
||||||
env->context(), Null(env->isolate()), argc, argv).ToLocal(out);
|
env->context(), Null(env->isolate()), argc, argv).ToLocal(out);
|
||||||
|
|
||||||
// If there was an error during bootstrap then it was either handled by the
|
// If there was an error during bootstrap then it was either handled by the
|
||||||
@ -3362,16 +3362,18 @@ void LoadEnvironment(Environment* env) {
|
|||||||
// are not safe to ignore.
|
// are not safe to ignore.
|
||||||
try_catch.SetVerbose(false);
|
try_catch.SetVerbose(false);
|
||||||
|
|
||||||
// The factory scripts are lib/internal/bootstrap_loaders.js and
|
// The bootstrapper scripts are lib/internal/bootstrap/loaders.js and
|
||||||
// lib/internal/bootstrap_node.js, each included as a static C string
|
// lib/internal/bootstrap/node.js, each included as a static C string
|
||||||
// defined in node_javascript.h, generated in node_javascript.cc by
|
// defined in node_javascript.h, generated in node_javascript.cc by
|
||||||
// node_js2c.
|
// node_js2c.
|
||||||
|
Local<String> loaders_name =
|
||||||
|
FIXED_ONE_BYTE_STRING(env->isolate(), "internal/bootstrap/loaders.js");
|
||||||
Local<Function> loaders_bootstrapper =
|
Local<Function> loaders_bootstrapper =
|
||||||
GetBootstrapper(env, LoadersBootstrapperSource(env),
|
GetBootstrapper(env, LoadersBootstrapperSource(env), loaders_name);
|
||||||
FIXED_ONE_BYTE_STRING(env->isolate(), "bootstrap_loaders.js"));
|
Local<String> node_name =
|
||||||
|
FIXED_ONE_BYTE_STRING(env->isolate(), "internal/bootstrap/node.js");
|
||||||
Local<Function> node_bootstrapper =
|
Local<Function> node_bootstrapper =
|
||||||
GetBootstrapper(env, NodeBootstrapperSource(env),
|
GetBootstrapper(env, NodeBootstrapperSource(env), node_name);
|
||||||
FIXED_ONE_BYTE_STRING(env->isolate(), "bootstrap_node.js"));
|
|
||||||
|
|
||||||
// Add a reference to the global object
|
// Add a reference to the global object
|
||||||
Local<Object> global = env->context()->Global();
|
Local<Object> global = env->context()->Global();
|
||||||
@ -4285,7 +4287,7 @@ void Init(int* argc,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Needed for access to V8 intrinsics. Disabled again during bootstrapping,
|
// Needed for access to V8 intrinsics. Disabled again during bootstrapping,
|
||||||
// see lib/internal/bootstrap_node.js.
|
// see lib/internal/bootstrap/node.js.
|
||||||
const char allow_natives_syntax[] = "--allow_natives_syntax";
|
const char allow_natives_syntax[] = "--allow_natives_syntax";
|
||||||
V8::SetFlagsFromString(allow_natives_syntax,
|
V8::SetFlagsFromString(allow_natives_syntax,
|
||||||
sizeof(allow_natives_syntax) - 1);
|
sizeof(allow_natives_syntax) - 1);
|
||||||
|
@ -183,13 +183,13 @@ extern bool config_experimental_vm_modules;
|
|||||||
|
|
||||||
// Set in node.cc by ParseArgs when --loader is used.
|
// Set in node.cc by ParseArgs when --loader is used.
|
||||||
// Used in node_config.cc to set a constant on process.binding('config')
|
// Used in node_config.cc to set a constant on process.binding('config')
|
||||||
// that is used by lib/internal/bootstrap_node.js
|
// that is used by lib/internal/bootstrap/node.js
|
||||||
extern std::string config_userland_loader;
|
extern std::string config_userland_loader;
|
||||||
|
|
||||||
// Set in node.cc by ParseArgs when --expose-internals or --expose_internals is
|
// Set in node.cc by ParseArgs when --expose-internals or --expose_internals is
|
||||||
// used.
|
// used.
|
||||||
// Used in node_config.cc to set a constant on process.binding('config')
|
// Used in node_config.cc to set a constant on process.binding('config')
|
||||||
// that is used by lib/internal/bootstrap_node.js
|
// that is used by lib/internal/bootstrap/node.js
|
||||||
extern bool config_expose_internals;
|
extern bool config_expose_internals;
|
||||||
|
|
||||||
// Set in node.cc by ParseArgs when --redirect-warnings= is used.
|
// Set in node.cc by ParseArgs when --redirect-warnings= is used.
|
||||||
|
@ -2275,7 +2275,7 @@ const Local<Value> URL::ToObject(Environment* env) const {
|
|||||||
// The SetURLConstructor method must have been called already to
|
// The SetURLConstructor method must have been called already to
|
||||||
// set the constructor function used below. SetURLConstructor is
|
// set the constructor function used below. SetURLConstructor is
|
||||||
// called automatically when the internal/url.js module is loaded
|
// called automatically when the internal/url.js module is loaded
|
||||||
// during the internal/bootstrap_node.js processing.
|
// during the internal/bootstrap/node.js processing.
|
||||||
ret = env->url_constructor_function()
|
ret = env->url_constructor_function()
|
||||||
->Call(env->context(), undef, arraysize(argv), argv);
|
->Call(env->context(), undef, arraysize(argv), argv);
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,4 @@ RangeError: Invalid input
|
|||||||
at tryModuleLoad (module.js:*:*)
|
at tryModuleLoad (module.js:*:*)
|
||||||
at Function.Module._load (module.js:*:*)
|
at Function.Module._load (module.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
|
@ -11,5 +11,5 @@ AssertionError [ERR_ASSERTION]: 1 strictEqual 2
|
|||||||
at tryModuleLoad (module.js:*:*)
|
at tryModuleLoad (module.js:*:*)
|
||||||
at Function.Module._load (module.js:*:*)
|
at Function.Module._load (module.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
@ -8,9 +8,9 @@ SyntaxError: Strict mode code may not include a with statement
|
|||||||
at Object.runInThisContext (vm.js:*:*)
|
at Object.runInThisContext (vm.js:*:*)
|
||||||
at Object.<anonymous> ([eval]-wrapper:*:*)
|
at Object.<anonymous> ([eval]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
42
|
42
|
||||||
42
|
42
|
||||||
[eval]:1
|
[eval]:1
|
||||||
@ -23,9 +23,9 @@ Error: hello
|
|||||||
at Object.runInThisContext (vm.js:*:*)
|
at Object.runInThisContext (vm.js:*:*)
|
||||||
at Object.<anonymous> ([eval]-wrapper:*:*)
|
at Object.<anonymous> ([eval]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
|
||||||
[eval]:1
|
[eval]:1
|
||||||
throw new Error("hello")
|
throw new Error("hello")
|
||||||
@ -37,9 +37,9 @@ Error: hello
|
|||||||
at Object.runInThisContext (vm.js:*:*)
|
at Object.runInThisContext (vm.js:*:*)
|
||||||
at Object.<anonymous> ([eval]-wrapper:*:*)
|
at Object.<anonymous> ([eval]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
100
|
100
|
||||||
[eval]:1
|
[eval]:1
|
||||||
var x = 100; y = x;
|
var x = 100; y = x;
|
||||||
@ -51,9 +51,9 @@ ReferenceError: y is not defined
|
|||||||
at Object.runInThisContext (vm.js:*:*)
|
at Object.runInThisContext (vm.js:*:*)
|
||||||
at Object.<anonymous> ([eval]-wrapper:*:*)
|
at Object.<anonymous> ([eval]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
|
||||||
[eval]:1
|
[eval]:1
|
||||||
var ______________________________________________; throw 10
|
var ______________________________________________; throw 10
|
||||||
|
@ -12,11 +12,11 @@ Error: foo:bar
|
|||||||
at tryModuleLoad (module.js:*:*)
|
at tryModuleLoad (module.js:*:*)
|
||||||
at Function.Module._load (module.js:*:*)
|
at Function.Module._load (module.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
Emitted 'error' event at:
|
Emitted 'error' event at:
|
||||||
at quux (*events_unhandled_error_common_trace.js:*:*)
|
at quux (*events_unhandled_error_common_trace.js:*:*)
|
||||||
at Object.<anonymous> (*events_unhandled_error_common_trace.js:*:*)
|
at Object.<anonymous> (*events_unhandled_error_common_trace.js:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
[... lines matching original stack trace ...]
|
[... lines matching original stack trace ...]
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
@ -10,11 +10,11 @@ Error
|
|||||||
at tryModuleLoad (module.js:*:*)
|
at tryModuleLoad (module.js:*:*)
|
||||||
at Function.Module._load (module.js:*:*)
|
at Function.Module._load (module.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
Emitted 'error' event at:
|
Emitted 'error' event at:
|
||||||
at process.nextTick (*events_unhandled_error_nexttick.js:*:*)
|
at process.nextTick (*events_unhandled_error_nexttick.js:*:*)
|
||||||
at process._tickCallback (internal/process/next_tick.js:*:*)
|
at process._tickCallback (internal/process/next_tick.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
@ -10,10 +10,10 @@ Error
|
|||||||
at tryModuleLoad (module.js:*:*)
|
at tryModuleLoad (module.js:*:*)
|
||||||
at Function.Module._load (module.js:*:*)
|
at Function.Module._load (module.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
Emitted 'error' event at:
|
Emitted 'error' event at:
|
||||||
at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*)
|
at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
[... lines matching original stack trace ...]
|
[... lines matching original stack trace ...]
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
@ -6,5 +6,5 @@ ReferenceError: undefined_reference_error_maker is not defined
|
|||||||
at *test*message*nexttick_throw.js:*:*
|
at *test*message*nexttick_throw.js:*:*
|
||||||
at process._tickCallback (internal/process/next_tick.js:*:*)
|
at process._tickCallback (internal/process/next_tick.js:*:*)
|
||||||
at Function.Module.runMain (module.js:*:*)
|
at Function.Module.runMain (module.js:*:*)
|
||||||
at startup (bootstrap_node.js:*:*)
|
at startup (internal/bootstrap/node.js:*:*)
|
||||||
at bootstrapNodeJSCore (bootstrap_node.js:*:*)
|
at bootstrapNodeJSCore (internal/bootstrap/node.js:*:*)
|
||||||
|
@ -8,8 +8,8 @@ SyntaxError: Strict mode code may not include a with statement
|
|||||||
at Object.runInThisContext (vm.js:*)
|
at Object.runInThisContext (vm.js:*)
|
||||||
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.<anonymous> (bootstrap_node.js:*:*)
|
at Socket.<anonymous> (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.emit (events.js:*:*)
|
at Socket.emit (events.js:*:*)
|
||||||
at endReadableNT (_stream_readable.js:*:*)
|
at endReadableNT (_stream_readable.js:*:*)
|
||||||
at process._tickCallback (internal/process/next_tick.js:*:*)
|
at process._tickCallback (internal/process/next_tick.js:*:*)
|
||||||
@ -25,8 +25,8 @@ Error: hello
|
|||||||
at Object.runInThisContext (vm.js:*)
|
at Object.runInThisContext (vm.js:*)
|
||||||
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.<anonymous> (bootstrap_node.js:*:*)
|
at Socket.<anonymous> (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.emit (events.js:*:*)
|
at Socket.emit (events.js:*:*)
|
||||||
at endReadableNT (_stream_readable.js:*:*)
|
at endReadableNT (_stream_readable.js:*:*)
|
||||||
at process._tickCallback (internal/process/next_tick.js:*:*)
|
at process._tickCallback (internal/process/next_tick.js:*:*)
|
||||||
@ -40,8 +40,8 @@ Error: hello
|
|||||||
at Object.runInThisContext (vm.js:*)
|
at Object.runInThisContext (vm.js:*)
|
||||||
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.<anonymous> (bootstrap_node.js:*:*)
|
at Socket.<anonymous> (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.emit (events.js:*:*)
|
at Socket.emit (events.js:*:*)
|
||||||
at endReadableNT (_stream_readable.js:*:*)
|
at endReadableNT (_stream_readable.js:*:*)
|
||||||
at process._tickCallback (internal/process/next_tick.js:*:*)
|
at process._tickCallback (internal/process/next_tick.js:*:*)
|
||||||
@ -56,8 +56,8 @@ ReferenceError: y is not defined
|
|||||||
at Object.runInThisContext (vm.js:*)
|
at Object.runInThisContext (vm.js:*)
|
||||||
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
at Object.<anonymous> ([stdin]-wrapper:*:*)
|
||||||
at Module._compile (module.js:*:*)
|
at Module._compile (module.js:*:*)
|
||||||
at evalScript (bootstrap_node.js:*:*)
|
at evalScript (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.<anonymous> (bootstrap_node.js:*:*)
|
at Socket.<anonymous> (internal/bootstrap/node.js:*:*)
|
||||||
at Socket.emit (events.js:*:*)
|
at Socket.emit (events.js:*:*)
|
||||||
at endReadableNT (_stream_readable.js:*:*)
|
at endReadableNT (_stream_readable.js:*:*)
|
||||||
at process._tickCallback (internal/process/next_tick.js:*:*)
|
at process._tickCallback (internal/process/next_tick.js:*:*)
|
||||||
|
@ -6,16 +6,16 @@ const common = require('../common');
|
|||||||
|
|
||||||
common.expectsError(
|
common.expectsError(
|
||||||
() => {
|
() => {
|
||||||
require('internal/bootstrap_loaders');
|
require('internal/bootstrap/loaders');
|
||||||
}, {
|
}, {
|
||||||
code: 'MODULE_NOT_FOUND',
|
code: 'MODULE_NOT_FOUND',
|
||||||
message: 'Cannot find module \'internal/bootstrap_loaders\''
|
message: 'Cannot find module \'internal/bootstrap/loaders\''
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
common.expectsError(
|
common.expectsError(
|
||||||
() => {
|
() => {
|
||||||
const source = 'module.exports = require("internal/bootstrap_loaders")';
|
const source = 'module.exports = require("internal/bootstrap/loaders")';
|
||||||
process.binding('natives').owo = source;
|
process.binding('natives').owo = source;
|
||||||
require('owo');
|
require('owo');
|
||||||
}, {
|
}, {
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// This test ensures that overwriting a process configuration
|
// This test ensures that overwriting a process configuration
|
||||||
// value does not affect code in bootstrap_node.js. Specifically this tests
|
// value does not affect code in lib/internal/bootstrap/node.js.
|
||||||
|
// Specifically this tests
|
||||||
// that the inspector console functions are bound even though
|
// that the inspector console functions are bound even though
|
||||||
// overwrite-config-preload-module.js overwrote the process.config variable.
|
// overwrite-config-preload-module.js overwrote the process.config variable.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user