Simplify jQuery( html, props ), closes gh-765.

This commit is contained in:
Scott González 2012-05-04 13:55:23 -04:00 committed by Dave Methvin
parent a743be19bd
commit 95a4a776cf

View File

@ -116,19 +116,16 @@ jQuery.fn = jQuery.prototype = {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
doc = ( context ? context.ownerDocument || context : document );
doc = ( context && context.nodeType ? context.ownerDocument || context : document );
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
selector = [ doc.createElement( ret[1] ) ];
if ( jQuery.isPlainObject( context ) ) {
this.attr.call( selector, context, true );
}
} else {