Skip to content

Commit 62e50cc

Browse files
committed
Fixes isCore bug
1 parent f21d02b commit 62e50cc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/async.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ module.exports = function resolve(x, options, callback) {
109109
if ((/\/$/).test(x) && res === basedir) {
110110
loadAsDirectory(res, opts.package, onfile);
111111
} else loadAsFile(res, opts.package, onfile);
112+
} else if (isCore(x)) {
113+
return cb(null, x);
112114
} else loadNodeModules(x, basedir, function (err, n, pkg) {
113115
if (err) cb(err);
114-
else if (isCore(x)) return cb(null, x);
115116
else if (n) {
116117
return maybeUnwrapSymlink(n, opts, function (err, realN) {
117118
if (err) {

lib/sync.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ module.exports = function (x, options) {
8888
if (n) return maybeUnwrapSymlink(n, opts);
8989
}
9090

91-
if (isCore(x)) return x;
92-
9391
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
9492
err.code = 'MODULE_NOT_FOUND';
9593
throw err;

0 commit comments

Comments
 (0)