Skip to content

Commit

Permalink
Merge branch '8017lint' of https://github.com/rwldrn/jquery into 8017…
Browse files Browse the repository at this point in the history
…lint
  • Loading branch information
rwaldron authored and jitter committed Jan 21, 2011
1 parent 1922f31 commit f1bd0cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/manipulation.js
Expand Up @@ -486,7 +486,8 @@ jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var clone = elem.cloneNode(true),
srcElements,
destElements;
destElements,
i;

if ( !jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// IE copies events bound via attachEvent when using cloneNode.
Expand All @@ -503,7 +504,7 @@ jQuery.extend({
// Weird iteration because IE will replace the length property
// with an element if you are cloning the body and one of the
// elements on the page has a name or id of "length"
for ( var i = 0; srcElements[i]; ++i ) {
for ( i = 0; srcElements[i]; ++i ) {
cloneFixAttributes( srcElements[i], destElements[i] );
}

Expand All @@ -521,7 +522,7 @@ jQuery.extend({
destElements = clone.getElementsByTagName("*");

if ( srcElements.length ) {
for ( var i = 0; srcElements[i]; ++i ) {
for ( i = 0; srcElements[i]; ++i ) {
cloneCopyEvent( srcElements[i], destElements[i] );
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/manipulation.js
Expand Up @@ -880,7 +880,7 @@ test("jQuery.clone() (#8017)", function() {
var main = jQuery("#main")[0],
clone = jQuery.clone( main );

equals( main.children.length, clone.children.length, "Simple child length to ensure a large dom tree copies correctly" );
equals( main.childNodes.length, clone.childNodes.length, "Simple child length to ensure a large dom tree copies correctly" );
});

test("clone()", function() {
Expand Down

0 comments on commit f1bd0cf

Please sign in to comment.