Commit fb0f2952 authored by Richard Gibson's avatar Richard Gibson

Fix #13282: QtWebKit (e.g., phantomjs) can only apply Arrays

parent f39ca223
...@@ -303,7 +303,9 @@ jQuery.fn.extend({ ...@@ -303,7 +303,9 @@ jQuery.fn.extend({
// Keep references to cloned scripts for later restoration // Keep references to cloned scripts for later restoration
if ( hasScripts ) { if ( hasScripts ) {
core_push.apply( scripts, getAll( node, "script" ) ); // Support: QtWebKit
// jQuery.merge because core_push.apply(_, arraylike) throws
jQuery.merge( scripts, getAll( node, "script" ) );
} }
} }
...@@ -369,7 +371,9 @@ jQuery.each({ ...@@ -369,7 +371,9 @@ jQuery.each({
elems = i === last ? this : this.clone( true ); elems = i === last ? this : this.clone( true );
jQuery( insert[ i ] )[ original ]( elems ); jQuery( insert[ i ] )[ original ]( elems );
core_push.apply( ret, elems ); // Support: QtWebKit
// .get() because core_push.apply(_, arraylike) throws
core_push.apply( ret, elems.get() );
} }
return this.pushStack( ret ); return this.pushStack( ret );
...@@ -433,7 +437,9 @@ jQuery.extend({ ...@@ -433,7 +437,9 @@ jQuery.extend({
// Add nodes directly // Add nodes directly
if ( jQuery.type( elem ) === "object" ) { if ( jQuery.type( elem ) === "object" ) {
core_push.apply( nodes, elem.nodeType ? [ elem ] : elem ); // Support: QtWebKit
// jQuery.merge because core_push.apply(_, arraylike) throws
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
// Convert non-html into a text node // Convert non-html into a text node
} else if ( !rhtml.test( elem ) ) { } else if ( !rhtml.test( elem ) ) {
...@@ -454,7 +460,9 @@ jQuery.extend({ ...@@ -454,7 +460,9 @@ jQuery.extend({
tmp = tmp.firstChild; tmp = tmp.firstChild;
} }
core_push.apply( nodes, tmp.childNodes ); // Support: QtWebKit
// jQuery.merge because core_push.apply(_, arraylike) throws
jQuery.merge( nodes, tmp.childNodes );
// Remember the top-level container // Remember the top-level container
tmp = fragment.firstChild; tmp = fragment.firstChild;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment