Skip to content

Commit

Permalink
fix array diff equality check, output
Browse files Browse the repository at this point in the history
  • Loading branch information
jclulow committed Feb 19, 2012
1 parent 20ceb33 commit ea57300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jsondiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function arrayDiff(a, b) {
var cc = makeLCSArray2(a, b);

function diffInternal(c, x, y, i, j) {
if (i > 0 && j > 0 && x[i - 1] === y[j - 1]) {
if (i > 0 && j > 0 && deepEqual(x[i - 1], y[j - 1])) {
diffInternal(c, x, y, i - 1, j - 1);
var va = x[i - 1];
var o = {
Expand Down Expand Up @@ -174,9 +174,9 @@ function arrayDiff(a, b) {
type: whatis(va)
};
if (o.type === 'object')
o.diff = objectDiff({}, va);
o.diff = objectDiff(va, {});
else if (o.type === 'array')
o.diff = arrayDiff([], va);
o.diff = arrayDiff(va, []);
else
o.value = va;
list.push(o);
Expand Down

0 comments on commit ea57300

Please sign in to comment.