]> source.dussan.org Git - jquery.git/commitdiff
Merge branch '8017lint' of https://github.com/rwldrn/jquery into 8017lint
authorrwldrn <waldron.rick@gmail.com>
Fri, 21 Jan 2011 23:41:42 +0000 (00:41 +0100)
committerAnton M <obhvsbypqghgc@gmail.com>
Fri, 21 Jan 2011 23:41:42 +0000 (00:41 +0100)
src/manipulation.js
test/unit/manipulation.js

index d758d803ff2834aba2743a9f6f5fdacf7416b777..b7f2d3e43796a0760f8799cf129947d7197e0fc3 100644 (file)
@@ -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] );
                                        }
                                }
index a68c214ba08f994d4941c458619c8721dfb456a6..739868bd7bf5d9d4b53e8f8cce78bb713d95dbd1 100644 (file)
@@ -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() {