From c2e71f69fa91f8c9027e7fcff628c4f062047074 Mon Sep 17 00:00:00 2001 From: "ran.styr" Date: Wed, 21 Jun 2017 20:36:51 +0300 Subject: [PATCH 1/2] add name _load to anonymous functions --- lib/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/module.js b/lib/module.js index ae6f4ff453ccc7..b7273d5c798c02 100644 --- a/lib/module.js +++ b/lib/module.js @@ -429,7 +429,7 @@ Module._resolveLookupPaths = function(request, parent, newReturn) { // 3. Otherwise, create a new module for the file and save it to the cache. // Then have it load the file contents before returning its exports // object. -Module._load = function(request, parent, isMain) { +Module._load = function _load(request, parent, isMain) { if (parent) { debug('Module._load REQUEST %s parent: %s', request, parent.id); } From c62e8af6c71e016d8f272dc6fa1ed2731a6de969 Mon Sep 17 00:00:00 2001 From: "ran.styr" Date: Wed, 21 Jun 2017 20:50:36 +0300 Subject: [PATCH 2/2] add name _load to anonymous functions --- lib/module.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/module.js b/lib/module.js index b7273d5c798c02..828274f648658f 100644 --- a/lib/module.js +++ b/lib/module.js @@ -158,7 +158,7 @@ function tryExtensions(p, exts, isMain) { } var warned = false; -Module._findPath = function(request, paths, isMain) { +Module._findPath = function _findPath(request, paths, isMain) { if (path.isAbsolute(request)) { paths = ['']; } else if (!paths || paths.length === 0) { @@ -243,7 +243,7 @@ var nmChars = [ 115, 101, 108, 117, 100, 111, 109, 95, 101, 100, 111, 110 ]; var nmLen = nmChars.length; if (process.platform === 'win32') { // 'from' is the __dirname of the module. - Module._nodeModulePaths = function(from) { + Module._nodeModulePaths = function _nodeModulePaths(from) { // guarantee that 'from' is absolute. from = path.resolve(from); @@ -285,7 +285,7 @@ if (process.platform === 'win32') { }; } else { // posix // 'from' is the __dirname of the module. - Module._nodeModulePaths = function(from) { + Module._nodeModulePaths = function _nodeModulePaths(from) { // guarantee that 'from' is absolute. from = path.resolve(from); // Return early not only to avoid unnecessary work, but to *avoid* returning @@ -326,7 +326,7 @@ if (process.platform === 'win32') { // 'index.' character codes var indexChars = [ 105, 110, 100, 101, 120, 46 ]; var indexLen = indexChars.length; -Module._resolveLookupPaths = function(request, parent, newReturn) { +Module._resolveLookupPaths = function _resolveLookupPaths(request, parent, newReturn) { if (NativeModule.nonInternalExists(request)) { debug('looking for %j in []', request); return (newReturn ? null : [request, []]); @@ -472,7 +472,7 @@ function tryModuleLoad(module, filename) { } } -Module._resolveFilename = function(request, parent, isMain) { +Module._resolveFilename = function _resolveFilename(request, parent, isMain) { if (NativeModule.nonInternalExists(request)) { return request; } @@ -491,7 +491,7 @@ Module._resolveFilename = function(request, parent, isMain) { // Given a file name, pass it to the proper extension handler. -Module.prototype.load = function(filename) { +Module.prototype.load = function load(filename) { debug('load %j for module %j', filename, this.id); assert(!this.loaded); @@ -507,7 +507,7 @@ Module.prototype.load = function(filename) { // Loads a module at the given file path. Returns that module's // `exports` property. -Module.prototype.require = function(path) { +Module.prototype.require = function require(path) { assert(path, 'missing path'); assert(typeof path === 'string', 'path must be a string'); return Module._load(path, this, /* isMain */ false); @@ -523,7 +523,7 @@ var resolvedArgv; // the correct helper variables (require, module, exports) to // the file. // Returns exception, if any. -Module.prototype._compile = function(content, filename) { +Module.prototype._compile = function _compile(content, filename) { content = internalModule.stripShebang(content); @@ -575,14 +575,14 @@ Module.prototype._compile = function(content, filename) { // Native extension for .js -Module._extensions['.js'] = function(module, filename) { +Module._extensions['.js'] = function _extensionsJS(module, filename) { var content = fs.readFileSync(filename, 'utf8'); module._compile(internalModule.stripBOM(content), filename); }; // Native extension for .json -Module._extensions['.json'] = function(module, filename) { +Module._extensions['.json'] = function _extensionsJSON(module, filename) { var content = fs.readFileSync(filename, 'utf8'); try { module.exports = JSON.parse(internalModule.stripBOM(content)); @@ -594,20 +594,20 @@ Module._extensions['.json'] = function(module, filename) { //Native extension for .node -Module._extensions['.node'] = function(module, filename) { +Module._extensions['.node'] = function _extensionsNode(module, filename) { return process.dlopen(module, path._makeLong(filename)); }; // bootstrap main module. -Module.runMain = function() { +Module.runMain = function runMain() { // Load the main module--the command line argument. Module._load(process.argv[1], null, true); // Handle any nextTicks added in the first tick of the program process._tickCallback(); }; -Module._initPaths = function() { +Module._initPaths = function _initPaths() { const isWindows = process.platform === 'win32'; var homeDir; @@ -635,7 +635,7 @@ Module._initPaths = function() { var nodePath = process.env['NODE_PATH']; if (nodePath) { - paths = nodePath.split(path.delimiter).filter(function(path) { + paths = nodePath.split(path.delimiter).filter(function pathsFilterCallback(path) { return !!path; }).concat(paths); } @@ -646,7 +646,7 @@ Module._initPaths = function() { Module.globalPaths = modulePaths.slice(0); }; -Module._preloadModules = function(requests) { +Module._preloadModules = function _preloadModules(requests) { if (!Array.isArray(requests)) return;