hyoo_sync_client 0.0.473 → 0.0.475

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/node.mjs CHANGED
@@ -2216,9 +2216,10 @@ var $;
2216
2216
  return right_cache;
2217
2217
  }
2218
2218
  else {
2219
- left_cache = new WeakMap([[right, true]]);
2219
+ left_cache = new WeakMap();
2220
2220
  $.$mol_compare_deep_cache.set(left, left_cache);
2221
2221
  }
2222
+ left_cache.set(right, true);
2222
2223
  let result;
2223
2224
  try {
2224
2225
  if (!left_proto)
package/node.test.js CHANGED
@@ -2207,9 +2207,10 @@ var $;
2207
2207
  return right_cache;
2208
2208
  }
2209
2209
  else {
2210
- left_cache = new WeakMap([[right, true]]);
2210
+ left_cache = new WeakMap();
2211
2211
  $.$mol_compare_deep_cache.set(left, left_cache);
2212
2212
  }
2213
+ left_cache.set(right, true);
2213
2214
  let result;
2214
2215
  try {
2215
2216
  if (!left_proto)
@@ -5772,6 +5773,20 @@ var $;
5772
5773
  b['self'] = b;
5773
5774
  $mol_assert_ok($mol_compare_deep(a, b));
5774
5775
  },
5776
+ 'same POJOs with cyclic reference with cache warmup'() {
5777
+ const obj1 = { test: 1, obj3: null };
5778
+ const obj1_copy = { test: 1, obj3: null };
5779
+ const obj2 = { test: 2, obj1 };
5780
+ const obj2_copy = { test: 2, obj1: obj1_copy };
5781
+ const obj3 = { test: 3, obj2 };
5782
+ const obj3_copy = { test: 3, obj2: obj2_copy };
5783
+ obj1.obj3 = obj3;
5784
+ obj1_copy.obj3 = obj3_copy;
5785
+ $mol_assert_not($mol_compare_deep(obj1, {}));
5786
+ $mol_assert_not($mol_compare_deep(obj2, {}));
5787
+ $mol_assert_not($mol_compare_deep(obj3, {}));
5788
+ $mol_assert_ok($mol_compare_deep(obj3, obj3_copy));
5789
+ },
5775
5790
  'Date'() {
5776
5791
  $mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
5777
5792
  $mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));