summaryrefslogtreecommitdiff
path: root/lib/module.js
diff options
context:
space:
mode:
authorMichaƫl Zasso <mic.besace@gmail.com>2015-06-16 13:24:08 -0700
committerBert Belder <bertbelder@gmail.com>2015-06-16 13:25:55 -0700
commit671e64ac732532892e543c0a8d6efd0b8639e757 (patch)
tree912907a304c4bd06caa0eb3a5fff4fdf84baf6b6 /lib/module.js
parent52a822d944ff24aa844636cdaff33152d769fb29 (diff)
downloadandroid-node-v8-671e64ac732532892e543c0a8d6efd0b8639e757.tar.gz
android-node-v8-671e64ac732532892e543c0a8d6efd0b8639e757.tar.bz2
android-node-v8-671e64ac732532892e543c0a8d6efd0b8639e757.zip
module: allow long paths for require on Windows
https://github.com/nodejs/io.js/pull/1801 introduced internal fs methods to speed up require. The methods do not call path._makeLong like their counterpart from the fs module. This brings back the old behaviour. Fixes: https://github.com/nodejs/io.js/issues/1990 Fixes: https://github.com/nodejs/io.js/issues/1980 Fixes: https://github.com/nodejs/io.js/issues/1849 PR-URL: https://github.com/nodejs/io.js/pull/1991/files Reviewed-By: Bert Belder <bertbelder@gmail.com>
Diffstat (limited to 'lib/module.js')
-rw-r--r--lib/module.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/module.js b/lib/module.js
index 844b683940..31f2063231 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -67,7 +67,7 @@ function readPackage(requestPath) {
}
var jsonPath = path.resolve(requestPath, 'package.json');
- var json = internalModuleReadFile(jsonPath);
+ var json = internalModuleReadFile(path._makeLong(jsonPath));
if (json === undefined) {
return false;
@@ -100,7 +100,7 @@ Module._realpathCache = {};
// check if the file exists and is not a directory
function tryFile(requestPath) {
- const rc = internalModuleStat(requestPath);
+ const rc = internalModuleStat(path._makeLong(requestPath));
return rc === 0 && toRealPath(requestPath);
}
@@ -146,7 +146,7 @@ Module._findPath = function(request, paths) {
var filename;
if (!trailingSlash) {
- const rc = internalModuleStat(basePath);
+ const rc = internalModuleStat(path._makeLong(basePath));
if (rc === 0) { // File.
filename = toRealPath(basePath);
} else if (rc === 1) { // Directory.