Skip to content

Commit 34c4e12

Browse files
jrburkedmethvin
authored andcommitted
Remove the define.amd.jQuery check, ref jquerygh-1150.
1 parent 3f05afb commit 34c4e12

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/exports.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@ if ( typeof module === "object" && typeof module.exports === "object" ) {
88
// Otherwise expose jQuery to the global object as usual
99
window.jQuery = window.$ = jQuery;
1010

11-
// Expose jQuery as an AMD module, but only for AMD loaders that
12-
// understand the issues with loading multiple versions of jQuery
13-
// in a page that all might call define(). The loader will indicate
14-
// they have special allowances for multiple jQuery versions by
15-
// specifying define.amd.jQuery = true. Register as a named module,
16-
// since jQuery can be concatenated with other files that may use define,
17-
// but not use a proper concatenation script that understands anonymous
18-
// AMD modules. A named AMD is safest and most robust way to register.
19-
// Lowercase jquery is used because AMD module names are derived from
20-
// file names, and jQuery is normally delivered in a lowercase file name.
21-
// Do this after creating the global so that if an AMD module wants to call
22-
// noConflict to hide this version of jQuery, it will work.
23-
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
11+
// Register as a named AMD module, since jQuery can be concatenated with other
12+
// files that may use define, but not via a proper concatenation script that
13+
// understands anonymous AMD modules. A named AMD is safest and most robust
14+
// way to register. Lowercase jquery is used because AMD module names are
15+
// derived from file names, and jQuery is normally delivered in a lowercase
16+
// file name. Do this after creating the global so that if an AMD module wants
17+
// to call noConflict to hide this version of jQuery, it will work.
18+
if ( typeof define === "function" && define.amd ) {
2419
define( "jquery", [], function () { return jQuery; } );
2520
}
2621
}

test/data/testinit.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ function define( name, dependencies, callback ) {
1919
amdDefined = callback();
2020
}
2121

22-
define.amd = {
23-
jQuery: true
24-
};
22+
define.amd = {};
2523

2624
/**
2725
* Returns an array of elements with the given IDs

0 commit comments

Comments
 (0)