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. // Create a safe reference to the Underscore object for use below.
var _ = function(obj) { return new wrapper(obj); }; var _ = function(obj) { return new wrapper(obj); };
// Export the Underscore object for **CommonJS**, with backwards-compatibility // Export the Underscore object for **Node.js** and **"CommonJS"**, with
// for the old `require()` API. If we're not in CommonJS, add `_` to the // backwards-compatibility for the old `require()` API. If we're not in
// global object. // CommonJS, add `_` to the global object.
if (typeof module !== 'undefined' && module.exports) { if (typeof exports !== 'undefined') {
module.exports = _; if (typeof module !== 'undefined' && module.exports) {
_._ = _; exports = module.exports = _;
} else if (typeof exports !== 'undefined' && exports) { }
exports._ = _; exports._ = _;
} else { } else {
// Exported as a string, for Closure Compiler "advanced" mode. // Exported as a string, for Closure Compiler "advanced" mode.