diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2016-04-15 13:32:36 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-04-20 09:45:57 -0700 |
commit | 75487f0db80e70a3e27fabfe323a33258dfbbea8 (patch) | |
tree | a95e928d3296616320be15d4d1738b1c5bec8505 /lib/module.js | |
parent | 8636af10129e822d8ae928ef3470a4dff9c4192a (diff) | |
download | android-node-v8-75487f0db80e70a3e27fabfe323a33258dfbbea8.tar.gz android-node-v8-75487f0db80e70a3e27fabfe323a33258dfbbea8.tar.bz2 android-node-v8-75487f0db80e70a3e27fabfe323a33258dfbbea8.zip |
module: fix resolution of filename with trailing slash
A recent optimization of module loading performance [1] forgot to check that
extensions were set in a certain code path.
[1] https://github.com/nodejs/node/pull/5172/commits/ae18bbef48d87d9c641df85369f62cfd5ed8c250
Fixes: https://github.com/nodejs/node/issues/6214
PR-URL: https://github.com/nodejs/node/pull/6215
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'lib/module.js')
-rw-r--r-- | lib/module.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/module.js b/lib/module.js index 29a23776d7..f633d62c49 100644 --- a/lib/module.js +++ b/lib/module.js @@ -170,6 +170,8 @@ Module._findPath = function(request, paths) { } if (!filename) { + if (exts === undefined) + exts = Object.keys(Module._extensions); filename = tryPackage(basePath, exts); } |