Fixes #335, exporting for Titanium.

This commit is contained in:
Jeremy Ashkenas
2011-10-18 16:51:45 -04:00
parent c30be2137c
commit 86eedd2a7b

View File

@@ -48,13 +48,13 @@
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) { return new wrapper(obj); };
// 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' && module.exports) {
module.exports = _;
_._ = _;
} else if (typeof exports !== 'undefined' && exports) {
// 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.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
// Exported as a string, for Closure Compiler "advanced" mode.