From 7288e9acba39a503134b87a300c60a5b20608dcf Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 28 Jul 2018 01:13:58 +0300 Subject: [PATCH] now patterns seem to work, but still not too happy with the code... Signed-off-by: Alex A. Naanou --- diff.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/diff.js b/diff.js index 5a7a309..8bb4917 100644 --- a/diff.js +++ b/diff.js @@ -256,9 +256,8 @@ var LogicTypePrototype = { } var res = this.__cmp__(obj, cmp, cache) - || (obj.__cmp__ ? - obj.__cmp__(this, cmp, cache) - : false) + || (obj.__cmp__ + && obj.__cmp__(this, cmp, cache)) c.set(obj, res) return res @@ -772,7 +771,11 @@ module.Types = { // same object... - if(bcmp(A, B)){ + // XXX this will essentially do a full diff of sub-objects, not + // sure if this is the right way to go here... + // ...this is not that big a dean as we are caching everything + // but still this is not obvious... + if(bcmp(A, B, cmp)){ return null }