Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't try to run extension loaders unless they're actually functions

  • Loading branch information...
commit dff1b5ad109113d007aca2c9a310f78129f48049 1 parent 9922e4e
@isaacs isaacs authored ry committed
View
1  src/node.js
@@ -251,6 +251,7 @@ var module = (function () {
this.filename = filename;
var extension = path.extname(filename) || '.js';
+ if (!extensions[extension]) extension = '.js';
extensions[extension](this, filename);
this.loaded = true;
};
View
1  test/fixtures/registerExt.hello.world
@@ -0,0 +1 @@
+exports.test = 'passed'
View
2  test/simple/test-module-loading.js
@@ -76,6 +76,8 @@ require.extensions['.test'] = function (module, filename) {
};
assert.equal(require('../fixtures/registerExt').test, "passed");
+// unknown extension, load as .js
+assert.equal(require('../fixtures/registerExt.hello.world').test, "passed");
common.debug('load custom file types that return non-strings');
require.extensions['.test'] = function (module, filename) {

0 comments on commit dff1b5a

Please sign in to comment.
Something went wrong with that request. Please try again.