diff --git a/lib/module.js b/lib/module.js index 313be6221f..0211197042 100644 --- a/lib/module.js +++ b/lib/module.js @@ -142,7 +142,8 @@ function findModulePath (id, dirs, callback) { path.join(dir, id + ".js"), path.join(dir, id + ".node"), path.join(dir, id, "index.js"), - path.join(dir, id, "index.node") + path.join(dir, id, "index.node"), + path.join(dir, id) ]; var ext; diff --git a/test/fixtures/foo b/test/fixtures/foo new file mode 100644 index 0000000000..66390ff24d --- /dev/null +++ b/test/fixtures/foo @@ -0,0 +1,2 @@ + +exports.foo = "ok" diff --git a/test/simple/test-module-loading.js b/test/simple/test-module-loading.js index 23574643a9..5245e4ea0f 100644 --- a/test/simple/test-module-loading.js +++ b/test/simple/test-module-loading.js @@ -103,6 +103,9 @@ debug("load modules by absolute id, then change require.paths, and load another var foo = require("../fixtures/require-path/p1/foo"); process.assert(foo.bar.expect === foo.bar.actual); +assert.equal(require('../fixtures/foo').foo, 'ok', + 'require module with no extension'); + process.addListener("exit", function () { assert.equal(true, a.A instanceof Function); assert.equal("A done", a.A());