maccman/sprockets-commonjs — pull request #20 by antifuchs (2013-03-11 21:25:50+00:00)
Title: Fix module contract for modules that assign exports

This change makes sprockets-commonjs compliant with the "Module context" contract, paragraph 1.3: "[...]the object returned by "require" must contain at least the exports that the foreign module has prepared[...]".

Some code bases use the (not yet specified/clarified in CommonJS)
method of assigning exports to export things. If, in these code bases,
they then go on to require more code that depends on the previous
module's exports, that new code won't see these exports unless we
re-cache the exports here, thus breaking that paragraph above.