- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
scottgonzalez
Author
Member
|
||
|
||
// 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 ) { | ||
selector = [ doc.createElement( ret[1] ) ]; | ||
if ( jQuery.isPlainObject( context ) ) { | ||
selector = [ document.createElement( ret[1] ) ]; | ||
jQuery.fn.attr.call( selector, context, true ); | ||
|
||
} else { | ||
selector = [ doc.createElement( ret[1] ) ]; | ||
this.attr.call( selector, context, true ); | ||
} | ||
|
||
} else { | ||
Did you mean to commit this? Doesn't appear to be related to the PR-summary/commit-msg.
I'd ask to add a unit test to verify that passing
{ ownerDocument: 1 }
ascontext
doesn't fail, but that looks a little silly. But if it is worth fixing, maybe a unit test is justified?