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['_'] = _; }