Skip to content

Commit 4d138d7

Browse files
arcanisljharb
authored andcommitted
Fixes isCore bug
1 parent b192e97 commit 4d138d7

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
@@ -105,9 +105,10 @@ module.exports = function resolve(x, options, callback) {
105105
if ((/\/$/).test(x) && res === basedir) {
106106
loadAsDirectory(res, opts.package, onfile);
107107
} else loadAsFile(res, opts.package, onfile);
108+
} else if (isCore(x)) {
109+
return cb(null, x);
108110
} else loadNodeModules(x, basedir, function (err, n, pkg) {
109111
if (err) cb(err);
110-
else if (isCore(x)) return cb(null, x);
111112
else if (n) {
112113
return maybeUnwrapSymlink(n, opts, function (err, realN) {
113114
if (err) {

lib/sync.js

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

87-
if (isCore(x)) return x;
88-
8987
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
9088
err.code = 'MODULE_NOT_FOUND';
9189
throw err;

0 commit comments

Comments
 (0)