Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgol committed Nov 17, 2013
1 parent 8f7db68 commit dc649a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/intro.js
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit dc649a3

Please sign in to comment.