From 0d4b1247c45083c695cab4242c084a97aa600221 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 11 Jan 2012 11:17:40 -0500 Subject: [PATCH] Removing AMD 'support' from Underscore. --- underscore.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/underscore.js b/underscore.js index c8cd1fd0e..0d078a6a7 100644 --- a/underscore.js +++ b/underscore.js @@ -48,21 +48,16 @@ // Create a safe reference to the Underscore object for use below. var _ = function(obj) { return new wrapper(obj); }; - // 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. + // 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. if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = _; } exports._ = _; - } else if (typeof define === 'function' && define.amd) { - // Register as a named module with AMD. - define('underscore', function() { - return _; - }); } else { - // Exported as a string, for Closure Compiler "advanced" mode. root['_'] = _; }