Skip to content

Commit

Permalink
Safer CommonJS detection... module.exports must be defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Dec 1, 2010
1 parent 2badecf commit c86a2fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
// Export the Underscore object for **CommonJS**, with backwards-compatibility
// for the old `require()` API. If we're not in CommonJS, add `_` to the
// global object.
if (typeof module !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
module.exports = _;
_._ = _;
} else {
Expand Down

0 comments on commit c86a2fe

Please sign in to comment.