Removing AMD 'support' from Underscore.

This commit is contained in:
Jeremy Ashkenas
2012-01-11 11:17:40 -05:00
parent 0b74f2d665
commit 0d4b1247c4

View File

@@ -48,21 +48,16 @@
// 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 **Node.js** and **"CommonJS"**, with // Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're not in // backwards-compatibility for the old `require()` API. If we're in
// CommonJS, add `_` to the global object. // the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
if (typeof exports !== 'undefined') { if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) { if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _; exports = module.exports = _;
} }
exports._ = _; exports._ = _;
} else if (typeof define === 'function' && define.amd) {
// Register as a named module with AMD.
define('underscore', function() {
return _;
});
} else { } else {
// Exported as a string, for Closure Compiler "advanced" mode.
root['_'] = _; root['_'] = _;
} }