aboutsummaryrefslogtreecommitdiffstats
path: root/src/wrapper-factory.js
blob: 212ff33bf60e5ca0d9f7432490d2e774e094a8e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*!
 * 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:
//
//     const jQuery = require( "jquery/factory" )( window );
//
// See ticket trac-14549 for more info.
function jQueryFactoryWrapper( window, noGlobal ) {

"use strict";

if ( !window.document ) {
	throw new Error( "jQuery requires a window with a document" );
}

// @CODE
// build.js inserts compiled jQuery here

return jQuery;

}

function jQueryFactory( window ) {
	"use strict";

	return jQueryFactoryWrapper( window, true );
}

module.exports = { jQueryFactory: jQueryFactory };