Merging in a patch for _ = require('underscore')

This commit is contained in:
Jeremy Ashkenas
2010-11-30 11:59:45 -05:00
parent a3106a99a6
commit 71439c35ac

View File

@@ -47,14 +47,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') {
// Export the Underscore object for **CommonJS**.
module.exports = _;
// Backwards compat with old requiring api
_._ = _;
} else {
// Export Underscore to the global scope.
root._ = _;
}