( window, noGlobal )
| 16 | // |
| 17 | // See ticket trac-14549 for more info. |
| 18 | function jQueryFactoryWrapper( window, noGlobal ) { |
| 19 | |
| 20 | if ( !window.document ) { |
| 21 | throw new Error( "jQuery requires a window with a document" ); |
| 22 | } |
| 23 | |
| 24 | var arr = []; |
| 25 | |
| 26 | var getProto = Object.getPrototypeOf; |
| 27 | |
| 28 | var slice = arr.slice; |
| 29 | |
| 30 | // Support: IE 11+ |
| 31 | // IE doesn't have Array#flat; provide a fallback. |
| 32 | var flat = arr.flat ? function( array ) { |
| 33 | return arr.flat.call( array ); |
| 34 | } : function( array ) { |
| 35 | return arr.concat.apply( [], array ); |
| 36 | }; |
| 37 | |
| 38 | var push = arr.push; |
| 39 | |
| 40 | var indexOf = arr.indexOf; |
| 41 | |
| 42 | // [[Class]] -> type pairs |
| 43 | var class2type = {}; |
| 44 | |
| 45 | var toString = class2type.toString; |
| 46 | |
| 47 | var hasOwn = class2type.hasOwnProperty; |
| 48 | |
| 49 | var fnToString = hasOwn.toString; |
| 50 | |
| 51 | var ObjectFunctionString = fnToString.call( Object ); |
| 52 | |
| 53 | // All support tests are defined in their respective modules. |
| 54 | var support = {}; |
| 55 | |
| 56 | function toType( obj ) { |
| 57 | if ( obj == null ) { |
| 58 | return obj + ""; |
| 59 | } |
| 60 | |
| 61 | return typeof obj === "object" ? |
| 62 | class2type[ toString.call( obj ) ] || "object" : |
| 63 | typeof obj; |
| 64 | } |
| 65 | |
| 66 | function isWindow( obj ) { |
| 67 | return obj != null && obj === obj.window; |
| 68 | } |
| 69 | |
| 70 | function isArrayLike( obj ) { |
| 71 | |
| 72 | var length = !!obj && obj.length, |
| 73 | type = toType( obj ); |
| 74 | |
| 75 | if ( typeof obj === "function" || isWindow( obj ) ) { |
no test coverage detected