From 71439c35ac46960915d6231757e5d3ae4ac6b661 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Tue, 30 Nov 2010 11:59:45 -0500 Subject: [PATCH] Merging in a patch for _ = require('underscore') --- underscore.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/underscore.js b/underscore.js index f59dc5350..cfd9a0763 100644 --- a/underscore.js +++ b/underscore.js @@ -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._ = _; }