Permalink
Browse files

Make the exports system include the wrapper function in node.js

  • Loading branch information...
creationix committed Nov 9, 2009
1 parent f6e67a5 commit 111f1cbc0d65e4d6680398091a017a9c4e53d153
Showing with 7 additions and 2 deletions.
  1. +1 −1 underscore-min.js
  2. +6 −1 underscore.js
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -25,7 +25,12 @@
var _ = root._ = function(obj) { return new wrapper(obj); };
// Export the Underscore object for CommonJS.
- if (typeof exports !== 'undefined') _ = exports;
+ if (module && typeof module.exports !== 'undefined') {
+ // richer binding for systems that allow it (node.js for example)
+ module.exports = _;
+ } else {
+ if (typeof exports !== 'undefined') _ = exports;
+ }
// Current version.
_.VERSION = '0.4.2';

0 comments on commit 111f1cb

Please sign in to comment.