mol_regexp 0.0.1271 → 0.0.1273

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_regexp",
3
- "version": "0.0.1271",
3
+ "version": "0.0.1273",
4
4
  "exports": {
5
5
  "node": {
6
6
  "import": "./node.mjs",
package/web.test.js CHANGED
@@ -762,9 +762,10 @@ var $;
762
762
  return right_cache;
763
763
  }
764
764
  else {
765
- left_cache = new WeakMap([[right, true]]);
765
+ left_cache = new WeakMap();
766
766
  $.$mol_compare_deep_cache.set(left, left_cache);
767
767
  }
768
+ left_cache.set(right, true);
768
769
  let result;
769
770
  try {
770
771
  if (!left_proto)
@@ -916,6 +917,20 @@ var $;
916
917
  b['self'] = b;
917
918
  $mol_assert_ok($mol_compare_deep(a, b));
918
919
  },
920
+ 'same POJOs with cyclic reference with cache warmup'() {
921
+ const obj1 = { test: 1, obj3: null };
922
+ const obj1_copy = { test: 1, obj3: null };
923
+ const obj2 = { test: 2, obj1 };
924
+ const obj2_copy = { test: 2, obj1: obj1_copy };
925
+ const obj3 = { test: 3, obj2 };
926
+ const obj3_copy = { test: 3, obj2: obj2_copy };
927
+ obj1.obj3 = obj3;
928
+ obj1_copy.obj3 = obj3_copy;
929
+ $mol_assert_not($mol_compare_deep(obj1, {}));
930
+ $mol_assert_not($mol_compare_deep(obj2, {}));
931
+ $mol_assert_not($mol_compare_deep(obj3, {}));
932
+ $mol_assert_ok($mol_compare_deep(obj3, obj3_copy));
933
+ },
919
934
  'Date'() {
920
935
  $mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
921
936
  $mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));