Skip to content

Commit

Permalink
fix: fix typo in diffing when appending children
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jul 20, 2017
1 parent 7f6168a commit 9863720
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -885,14 +885,11 @@
if(i$1 >= newLength) {
// Remove extra child
removeChild(oldChildren$1.pop().meta.el, node);
} else if(i$1 === oldLength) {
// Add extra children
var childVnode$1 = null;
for(; i$1 < newLength; i$1++) {
childVnode$1 = children$1[i$1];
oldChildren$1.push(childVnode$1);
appendChild(createNodeFromVNode(childVnode$1), childVnode$1, node);
}
} else if(i$1 >= oldLength) {
// Add extra child
child = children$1[i$1];
appendChild(createNodeFromVNode(child), child, node);
oldChildren$1.push(child);
} else {
// Diff child if they don't have the same reference
oldChild = oldChildren$1[i$1];
Expand Down
Loading

0 comments on commit 9863720

Please sign in to comment.