MCPcopy
hub / github.com/jquery/jquery / jQueryFactory

Function jQueryFactory

dist-module/jquery.slim.module.js:13–6842  ·  view source on GitHub ↗
( window, noGlobal )

Source from the content-addressed store, hash-verified

11// For ECMAScript module environments where a proper `window`
12// is present, execute the factory and get jQuery.
13function jQueryFactory( window, noGlobal ) {
14
15if ( typeof window === "undefined" || !window.document ) {
16 throw new Error( "jQuery requires a window with a document" );
17}
18
19var arr = [];
20
21var getProto = Object.getPrototypeOf;
22
23var slice = arr.slice;
24
25// Support: IE 11+
26// IE doesn't have Array#flat; provide a fallback.
27var flat = arr.flat ? function( array ) {
28 return arr.flat.call( array );
29} : function( array ) {
30 return arr.concat.apply( [], array );
31};
32
33var push = arr.push;
34
35var indexOf = arr.indexOf;
36
37// [[Class]] -> type pairs
38var class2type = {};
39
40var toString = class2type.toString;
41
42var hasOwn = class2type.hasOwnProperty;
43
44var fnToString = hasOwn.toString;
45
46var ObjectFunctionString = fnToString.call( Object );
47
48// All support tests are defined in their respective modules.
49var support = {};
50
51function toType( obj ) {
52 if ( obj == null ) {
53 return obj + "";
54 }
55
56 return typeof obj === "object" ?
57 class2type[ toString.call( obj ) ] || "object" :
58 typeof obj;
59}
60
61function isWindow( obj ) {
62 return obj != null && obj === obj.window;
63}
64
65function isArrayLike( obj ) {
66
67 var length = !!obj && obj.length,
68 type = toType( obj );
69
70 if ( typeof obj === "function" || isWindow( obj ) ) {

Callers 1

Calls 15

DOMEvalFunction · 0.70
isArrayLikeFunction · 0.70
createCacheFunction · 0.70
unescapeSelectorFunction · 0.70
selectorErrorFunction · 0.70
tokenizeFunction · 0.70
accessFunction · 0.70
nodeNameFunction · 0.70
addCombinatorFunction · 0.70
findFunction · 0.70
setDocumentFunction · 0.70
markFunctionFunction · 0.70

Tested by

no test coverage detected