joyent/node — pull request #5376 by sgentle (2013-04-27 06:27:49+00:00)
Title: module: fix for .foo.bar style multiple extensions

Hi,

I ran into some strange behaviour recently when trying to require a file with a .foo.bar style extension that was defined in require.extensions. `tryExtensions` works fine since it just uses simple string concatenation, but `Module.load` only passes the last part of the extension (eg .bar) to require.extensions, so it barfs, usually with a cryptic parse error because it's trying to read the file as javascript.

I figured this qualified as a bug (and so pointed the commit at 0.10) because it's inconsistent behaviour between different parts of the module loader, and I can't imagine a situation where you'd add '.foo.bar' to require.extensions and expect it to not be called.