aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-11-17 01:06:44 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2013-11-17 01:06:44 +0100
commitdc649a33e081c7beb083b04956731aa410eb6b3f (patch)
treed4e5b2098931c95a3a303cb7afe8741437c4c08b
parent8f7db68cbf1cdc3677d89dc1191bc50c8d47a82f (diff)
downloadjquery-dc649a33e081c7beb083b04956731aa410eb6b3f.tar.gz
jquery-dc649a33e081c7beb083b04956731aa410eb6b3f.zip
Change window to global in the most outer IIFE parameters.
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.
-rw-r--r--src/intro.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/intro.js b/src/intro.js
index 4b2f45171..417c61aab 100644
--- a/src/intro.js
+++ b/src/intro.js
@@ -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,16 +22,16 @@
// 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");
+ throw new Error( "jQuery requires a window with a document" );
}
return factory( w );
};
} else {
- factory( window );
+ factory( global );
}
// Pass this, window may not be defined yet