mol_dump_lib 0.0.457 → 0.0.459
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.d.ts +52 -52
- package/node.deps.json +1 -1
- package/node.js +2 -1
- package/node.js.map +1 -1
- package/node.mjs +2 -1
- package/node.test.js +16 -1
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +52 -52
- package/web.deps.json +1 -1
- package/web.js +2 -1
- package/web.js.map +1 -1
- package/web.mjs +2 -1
- package/web.test.js +14 -0
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -996,9 +996,10 @@ var $;
|
|
|
996
996
|
return right_cache;
|
|
997
997
|
}
|
|
998
998
|
else {
|
|
999
|
-
left_cache = new WeakMap(
|
|
999
|
+
left_cache = new WeakMap();
|
|
1000
1000
|
$.$mol_compare_deep_cache.set(left, left_cache);
|
|
1001
1001
|
}
|
|
1002
|
+
left_cache.set(right, true);
|
|
1002
1003
|
let result;
|
|
1003
1004
|
try {
|
|
1004
1005
|
if (!left_proto)
|
package/web.test.js
CHANGED
|
@@ -657,6 +657,20 @@ var $;
|
|
|
657
657
|
b['self'] = b;
|
|
658
658
|
$mol_assert_ok($mol_compare_deep(a, b));
|
|
659
659
|
},
|
|
660
|
+
'same POJOs with cyclic reference with cache warmup'() {
|
|
661
|
+
const obj1 = { test: 1, obj3: null };
|
|
662
|
+
const obj1_copy = { test: 1, obj3: null };
|
|
663
|
+
const obj2 = { test: 2, obj1 };
|
|
664
|
+
const obj2_copy = { test: 2, obj1: obj1_copy };
|
|
665
|
+
const obj3 = { test: 3, obj2 };
|
|
666
|
+
const obj3_copy = { test: 3, obj2: obj2_copy };
|
|
667
|
+
obj1.obj3 = obj3;
|
|
668
|
+
obj1_copy.obj3 = obj3_copy;
|
|
669
|
+
$mol_assert_not($mol_compare_deep(obj1, {}));
|
|
670
|
+
$mol_assert_not($mol_compare_deep(obj2, {}));
|
|
671
|
+
$mol_assert_not($mol_compare_deep(obj3, {}));
|
|
672
|
+
$mol_assert_ok($mol_compare_deep(obj3, obj3_copy));
|
|
673
|
+
},
|
|
660
674
|
'Date'() {
|
|
661
675
|
$mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
|
|
662
676
|
$mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
|