Skip to content

Commit

Permalink
Applied the jashkenas#431 pull request to release 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bibz committed Oct 8, 2013
1 parent 80a92f0 commit 7748670
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,22 @@
this._wrapped = obj;
};

// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
// Export the Underscore object for **Node.js** and **"CommonJS"**, with
// backwards-compatibility for the old `require()` API. If we're not in
// CommonJS, add `_` to the global object via a string identifier for
// the Closure Compiler "advanced" mode, and optionally register as an
// AMD module via define().
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
if (typeof define === 'function' && define.amd) {
define('underscore', function() {
return _;
});
}
root._ = _;
}

Expand Down

2 comments on commit 7748670

@jdalton
Copy link

@jdalton jdalton commented on 7748670 Oct 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use the underscore compat build of lodash which has AMD support baked in :3

@bibz
Copy link
Owner Author

@bibz bibz commented on 7748670 Oct 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks nice, I'll definitely have a look.
Thanks 👍

Please sign in to comment.