Register as a CommonJS async module if in that kind of environment. Fixes #7102.
This commit is contained in:
parent
01cba2ecaa
commit
6ffa730721
|
@ -886,6 +886,11 @@ function doScrollCheck() {
|
||||||
jQuery.ready();
|
jQuery.ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expose jQuery as an Asynchronous Module
|
||||||
|
if ( typeof define !== "undefined" ) {
|
||||||
|
define( "jquery", [], function () { return jQuery; } );
|
||||||
|
}
|
||||||
|
|
||||||
// Expose jQuery to the global object
|
// Expose jQuery to the global object
|
||||||
return (window.jQuery = window.$ = jQuery);
|
return (window.jQuery = window.$ = jQuery);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
var jQuery = this.jQuery || "jQuery", // For testing .noConflict()
|
var jQuery = this.jQuery || "jQuery", // For testing .noConflict()
|
||||||
$ = this.$ || "$",
|
$ = this.$ || "$",
|
||||||
originaljQuery = jQuery,
|
originaljQuery = jQuery,
|
||||||
original$ = $;
|
original$ = $,
|
||||||
|
commonJSDefined;
|
||||||
|
|
||||||
|
function define(module, dependencies, callback) {
|
||||||
|
commonJSDefined = callback();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of elements with the given IDs, eg.
|
* Returns an array of elements with the given IDs, eg.
|
||||||
|
|
|
@ -12,7 +12,9 @@ test("Basic requirements", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("jQuery()", function() {
|
test("jQuery()", function() {
|
||||||
expect(23);
|
expect(24);
|
||||||
|
|
||||||
|
strictEqual( commonJSDefined, jQuery, "CommonJS registered (Bug #7102)" );
|
||||||
|
|
||||||
// Basic constructor's behavior
|
// Basic constructor's behavior
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue