mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
34 lines
811 B
JavaScript
34 lines
811 B
JavaScript
|
/*!
|
||
|
* jQuery JavaScript Library v@VERSION
|
||
|
* https://jquery.com/
|
||
|
*
|
||
|
* Copyright OpenJS Foundation and other contributors
|
||
|
* Released under the MIT license
|
||
|
* https://jquery.org/license
|
||
|
*
|
||
|
* Date: @DATE
|
||
|
*/
|
||
|
// Expose a factory as `jQueryFactory`. Aimed at environments without
|
||
|
// a real `window` where an emulated window needs to be constructed. Example:
|
||
|
//
|
||
|
// import { jQueryFactory } from "jquery/factory";
|
||
|
// const jQuery = jQueryFactory( window );
|
||
|
//
|
||
|
// See ticket trac-14549 for more info.
|
||
|
function jQueryFactoryWrapper( window, noGlobal ) {
|
||
|
|
||
|
if ( !window.document ) {
|
||
|
throw new Error( "jQuery requires a window with a document" );
|
||
|
}
|
||
|
|
||
|
// @CODE
|
||
|
// build.js inserts compiled jQuery here
|
||
|
|
||
|
return jQuery;
|
||
|
|
||
|
}
|
||
|
|
||
|
export function jQueryFactory( window ) {
|
||
|
return jQueryFactoryWrapper( window, true );
|
||
|
}
|