Optimized jQuery(Element) to not call jQuery() twice.
This commit is contained in:
parent
bbf3334db1
commit
fd2a2fed84
11
src/core.js
11
src/core.js
|
@ -72,10 +72,13 @@ jQuery.fn = jQuery.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, we inject the element directly into the jQuery object
|
// Otherwise, we inject the element directly into the jQuery object
|
||||||
ret = jQuery( elem || null );
|
this.length = elem ? 1 : 0;
|
||||||
ret.context = document;
|
if ( elem ) {
|
||||||
ret.selector = selector;
|
this[0] = elem;
|
||||||
return ret;
|
}
|
||||||
|
this.context = document;
|
||||||
|
this.selector = selector;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HANDLE: $(expr, $(...))
|
// HANDLE: $(expr, $(...))
|
||||||
|
|
Loading…
Reference in a new issue