diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-01-24 23:45:44 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-01-24 23:45:44 -0500 |
commit | fb0f2952929fbe0e8a39da8c7865a397c7e74835 (patch) | |
tree | 5554c0a9a979536cc15bd45b852428cee82fcec9 /src/manipulation.js | |
parent | f39ca223e0f373222976a79204d0d8ea7718253e (diff) | |
download | jquery-fb0f2952929fbe0e8a39da8c7865a397c7e74835.tar.gz jquery-fb0f2952929fbe0e8a39da8c7865a397c7e74835.zip |
Fix #13282: QtWebKit (e.g., phantomjs) can only apply Arrays
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 9a2b3db66..9b70db7f3 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -303,7 +303,9 @@ jQuery.fn.extend({ // Keep references to cloned scripts for later restoration 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({ elems = i === last ? this : this.clone( true ); 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 ); @@ -433,7 +437,9 @@ jQuery.extend({ // Add nodes directly 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 } else if ( !rhtml.test( elem ) ) { @@ -454,7 +460,9 @@ jQuery.extend({ 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 tmp = fragment.firstChild; |