Skip to content
Permalink
Browse files

Fixes #13566. If there is a window object, define jQuery and $

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information...
rwaldron committed Apr 4, 2013
1 parent 32b066d commit 37c801eda5a96ba8d58f3d8751c42df296d3bd39
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/exports.js
@@ -5,9 +5,6 @@ if ( typeof module === "object" && typeof module.exports === "object" ) {
// upon in the Node module world.
module.exports = jQuery;
} else {
// Otherwise expose jQuery to the global object as usual
window.jQuery = window.$ = jQuery;

// Register as a named AMD module, since jQuery can be concatenated with other
// files that may use define, but not via a proper concatenation script that
// understands anonymous AMD modules. A named AMD is safest and most robust
@@ -19,3 +16,8 @@ if ( typeof module === "object" && typeof module.exports === "object" ) {
define( "jquery", [], function () { return jQuery; } );
}
}

// If there is a window object, define a jQuery and $
if ( typeof window === "object" ) {

This comment has been minimized.

@mourner

mourner Apr 23, 2013

I think this window check is unnecessary, because the global closure passes it inside with })(window); in outro.js, and if it's undefined, it will throw ReferenceError before reaching this line.

window.jQuery = window.$ = jQuery;
}

0 comments on commit 37c801e

Please sign in to comment.
You can’t perform that action at this time.