aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrburke <jrburke@gmail.com>2013-01-30 15:32:19 -0800
committerDave Methvin <dave.methvin@gmail.com>2013-02-28 17:21:18 -0500
commit34c4e122a333bbfc80bd4f6e79db20f3a73ae5b3 (patch)
tree48da6f1abb8b82143b5d37da048b82220c5394f5
parent3f05afbd8d9bbc75d30b68e720324d1ed984a315 (diff)
downloadjquery-34c4e122a333bbfc80bd4f6e79db20f3a73ae5b3.tar.gz
jquery-34c4e122a333bbfc80bd4f6e79db20f3a73ae5b3.zip
Remove the define.amd.jQuery check, ref gh-1150.
-rw-r--r--src/exports.js21
-rw-r--r--test/data/testinit.js4
2 files changed, 9 insertions, 16 deletions
diff --git a/src/exports.js b/src/exports.js
index c535b7eef..365c97bf6 100644
--- a/src/exports.js
+++ b/src/exports.js
@@ -8,19 +8,14 @@ if ( typeof module === "object" && typeof module.exports === "object" ) {
// Otherwise expose jQuery to the global object as usual
window.jQuery = window.$ = jQuery;
- // Expose jQuery as an AMD module, but only for AMD loaders that
- // understand the issues with loading multiple versions of jQuery
- // in a page that all might call define(). The loader will indicate
- // they have special allowances for multiple jQuery versions by
- // specifying define.amd.jQuery = true. Register as a named module,
- // since jQuery can be concatenated with other files that may use define,
- // but not use a proper concatenation script that understands anonymous
- // AMD modules. A named AMD is safest and most robust way to register.
- // Lowercase jquery is used because AMD module names are derived from
- // file names, and jQuery is normally delivered in a lowercase file name.
- // Do this after creating the global so that if an AMD module wants to call
- // noConflict to hide this version of jQuery, it will work.
- if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
+ // Register as a named AMD module, since jQuery can be concatenated with other
+ // files that may use define, but not via a proper concatenation script that
+ // understands anonymous AMD modules. A named AMD is safest and most robust
+ // way to register. Lowercase jquery is used because AMD module names are
+ // derived from file names, and jQuery is normally delivered in a lowercase
+ // file name. Do this after creating the global so that if an AMD module wants
+ // to call noConflict to hide this version of jQuery, it will work.
+ if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function () { return jQuery; } );
}
}
diff --git a/test/data/testinit.js b/test/data/testinit.js
index ea940cb63..87edfde29 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -19,9 +19,7 @@ function define( name, dependencies, callback ) {
amdDefined = callback();
}
-define.amd = {
- jQuery: true
-};
+define.amd = {};
/**
* Returns an array of elements with the given IDs