From f1bd0cfc4d3eabf566b6a3345d888e6db67bc00b Mon Sep 17 00:00:00 2001 From: rwldrn Date: Sat, 22 Jan 2011 00:41:42 +0100 Subject: [PATCH] Merge branch '8017lint' of https://github.com/rwldrn/jquery into 8017lint --- src/manipulation.js | 7 ++++--- test/unit/manipulation.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/manipulation.js b/src/manipulation.js index d758d80..b7f2d3e 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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. @@ -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] ); } @@ -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] ); } } diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index a68c214..739868b 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -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() { -- 1.7.10.4