Skip to content
Permalink
Browse files

Fix a potential error in the previous commit caused by the use of a s…

…eparate index variable.
  • Loading branch information...
csnover committed Dec 22, 2010
1 parent faefbb1 commit 7f617e0c9f39d5cc608a05f808e6defade498fda
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/manipulation.js
@@ -370,14 +370,18 @@ function root( elem, cur ) {
}

function cloneCopyEvent(orig, ret) {
var i = 0;

ret.each(function() {
if ( this.nodeType !== 1 || this.nodeName !== (orig[i] && orig[i].nodeName) || !jQuery.hasData(orig[i]) ) {
ret.each(function (nodeIndex) {
if ( this.nodeType !== 1 || !jQuery.hasData(orig[nodeIndex]) ) {
return;
}

var oldData = jQuery.data( orig[i++] ),
// XXX remove for 1.5 RC or merge back in if there is actually a reason for this check that has been
// unexposed by unit tests
if ( this.nodeName !== (orig[nodeIndex] && orig[nodeIndex].nodeName) ) {
throw "Cloned data mismatch";
}

var oldData = jQuery.data( orig[nodeIndex] ),
curData = jQuery.data( this, jQuery.extend(true, {}, oldData) ),
events = oldData && oldData.events;

0 comments on commit 7f617e0

Please sign in to comment.
You can’t perform that action at this time.