Permalink
Browse files

Merge pull request #3 from cliffano/master

Make resolve work with node v0.6.10
  • Loading branch information...
2 parents 5ce6491 + 773337f commit 2eee31a5fc02ed8758704dc3583baad2e6d68031 @felixge committed Feb 22, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/require-like.js
View
@@ -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 {

0 comments on commit 2eee31a

Please sign in to comment.