diff --git a/diff.js b/diff.js index 0af3669..8f54fe1 100644 --- a/diff.js +++ b/diff.js @@ -134,8 +134,7 @@ var getCommonSections = function(A, B, cmp, min_chunk){ // cache... var res = (cache[a] || [])[b] if(res != null){ - return res - } + return res } // collect common chunk... var chunk = { @@ -145,10 +144,10 @@ var getCommonSections = function(A, B, cmp, min_chunk){ } var l = chunk.length while((a+l < A.length && b+l < B.length) - // cmp non-empty slots only... - && ((a+l in A && b+l in B) ? - cmp(A[a+l], B[b+l]) - : (!(a+l in A) && !(b+l in B)))){ + // cmp non-empty slots only... + && ((a+l in A && b+l in B) ? + cmp(A[a+l], B[b+l]) + : (!(a+l in A) && !(b+l in B)))){ l = chunk.length += 1 } // ignore small chunks... l = chunk.length >= min_chunk ? diff --git a/diff2.js b/diff2.js index d972a9f..d830a12 100644 --- a/diff2.js +++ b/diff2.js @@ -80,6 +80,7 @@ module.HANDLERS = { // Functions... // + // XXX EXPERIMENTAL... // XXX STUB... func: { match: function(obj){ @@ -260,6 +261,7 @@ function(obj, handlers=module.HANDLERS){ +// // Format: // [ // [, {type: }], @@ -269,6 +271,7 @@ function(obj, handlers=module.HANDLERS){ // [, ], // ] // +// XXX add a tree mode -- containers as levels... // XXX need a way to index the path... // ...and to filter paths by pattern... // XXX might be a good idea to generate "structural hashes" for objects... @@ -407,6 +410,12 @@ function(...attrs){ +//--------------------------------------------------------------------- +// XXX construct... + + + + //--------------------------------------------------------------------- // XXX move to test...