Skip to content
Permalink
Browse files

lib: fix comment nits in bootstrap\loaders.js

Backport-PR-URL: #30338
PR-URL: #24641
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
vsemozhetbyt authored and MylesBorins committed Nov 23, 2018
1 parent 4ae8d20 commit 81c31005fdd779aadcd4585866162012db736762
Showing with 11 additions and 11 deletions.
  1. +11 −11 lib/internal/bootstrap/loaders.js
@@ -19,7 +19,7 @@
// can be created using NODE_MODULE_CONTEXT_AWARE_CPP() with the flag
// NM_F_LINKED.
// - internalBinding(): the private internal C++ binding loader, inaccessible
// from user land because they are only available from NativeModule.require()
// from user land because they are only available from NativeModule.require().
// These C++ bindings are created using NODE_MODULE_CONTEXT_AWARE_INTERNAL()
// and have their nm_flags set to NM_F_INTERNAL.
//
@@ -61,7 +61,7 @@
keys: ObjectKeys,
} = Object;

// Set up process.moduleLoadList
// Set up process.moduleLoadList.
const moduleLoadList = [];
ObjectDefineProperty(process, 'moduleLoadList', {
value: moduleLoadList,
@@ -70,7 +70,7 @@
writable: false
});

// Set up process.binding() and process._linkedBinding()
// Set up process.binding() and process._linkedBinding().
{
const bindingObj = ObjectCreate(null);

@@ -93,7 +93,7 @@
};
}

// Set up internalBinding() in the closure
// Set up internalBinding() in the closure.
let internalBinding;
{
const bindingObj = ObjectCreate(null);
@@ -115,11 +115,11 @@
};
}

// Create this WeakMap in js-land because V8 has no C++ API for WeakMap
// Create this WeakMap in js-land because V8 has no C++ API for WeakMap.
internalBinding('module_wrap').callbackMap = new WeakMap();
const { ContextifyScript } = process.binding('contextify');

// Set up NativeModule
// Set up NativeModule.
function NativeModule(id) {
this.filename = `${id}.js`;
this.id = id;
@@ -128,7 +128,7 @@
this.exportKeys = undefined;
this.loaded = false;
this.loading = false;
this.script = null; // The ContextifyScript of the module
this.script = null; // The ContextifyScript of the module.
}

NativeModule._source = getBinding('natives');
@@ -160,7 +160,7 @@
if (!NativeModule.exists(id)) {
// Model the error off the internal/errors.js model, but
// do not use that module given that it could actually be
// the one causing the error if there's a bug in Node.js
// the one causing the error if there's a bug in Node.js.
// eslint-disable-next-line no-restricted-syntax
const err = new Error(`No such built-in module: ${id}`);
err.code = 'ERR_UNKNOWN_BUILTIN_MODULE';
@@ -201,15 +201,15 @@

if (config.exposeInternals) {
NativeModule.nonInternalExists = function(id) {
// Do not expose this to user land even with --expose-internals
// Do not expose this to user land even with --expose-internals.
if (id === loaderId) {
return false;
}
return NativeModule.exists(id);
};

NativeModule.isInternal = function(id) {
// Do not expose this to user land even with --expose-internals
// Do not expose this to user land even with --expose-internals.
return id === loaderId;
};
} else {
@@ -243,7 +243,7 @@
};

// Provide named exports for all builtin libraries so that the libraries
// may be imported in a nicer way for esm users. The default export is left
// may be imported in a nicer way for ESM users. The default export is left
// as the entire namespace (module.exports) and wrapped in a proxy such
// that APMs and other behavior are still left intact.
NativeModule.prototype.proxifyExports = function() {

0 comments on commit 81c3100

Please sign in to comment.
You can’t perform that action at this time.