mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Change window to global in the most outer IIFE parameters. (cherry-picked from dc649a33e0
)
In the most outer IIFE it’s not yet known if the global is window or not. Using the window variable to denote the global was misleading in that case, especially that the code didn’t make such assumption, requiring to provide a Web-like window separately. Renaming window to global clears the confusion.
This commit is contained in:
parent
54419cb5ad
commit
91586997e0
@ -12,7 +12,7 @@
|
||||
* Date: @DATE
|
||||
*/
|
||||
|
||||
(function ( window, factory ) {
|
||||
(function( global, factory ) {
|
||||
|
||||
if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||
// For CommonJS and CommonJS-like environments where a proper window is present,
|
||||
@ -22,8 +22,8 @@
|
||||
// This accentuates the need for the creation of a real window
|
||||
// e.g. var jQuery = require("jquery")(window);
|
||||
// See ticket #14549 for more info
|
||||
module.exports = window.document ?
|
||||
factory( window ) :
|
||||
module.exports = global.document ?
|
||||
factory( global ) :
|
||||
function( w ) {
|
||||
if ( !w.document ) {
|
||||
throw new Error( "jQuery requires a window with a document" );
|
||||
@ -31,7 +31,7 @@
|
||||
return factory( w );
|
||||
};
|
||||
} else {
|
||||
factory( window );
|
||||
factory( global );
|
||||
}
|
||||
|
||||
// Pass this, window may not be defined yet
|
||||
|
Loading…
Reference in New Issue
Block a user