Skip to content

Commit

Permalink
Make resolve work with node v0.6.10 .
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffano committed Feb 7, 2012
1 parent 5ce6491 commit 773337f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/require-like.js
Expand Up @@ -20,7 +20,10 @@ module.exports = function requireLike(path, uncached) {


requireLike.resolve = function(request) {
return Module._resolveFilename(request, parentModule)[1];
var resolved = Module._resolveFilename(request, parentModule);
// Module._resolveFilename returns a string since node v0.6.10,
// it used to return an array prior to that
return (resolved instanceof Array) ? resolved[1] : resolved;
}

try {
Expand Down

0 comments on commit 773337f

Please sign in to comment.