mol_key 0.0.992 → 0.0.993
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.test.js +16 -1
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.test.js +16 -1
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -2078,9 +2078,10 @@ var $;
|
|
|
2078
2078
|
return right_cache;
|
|
2079
2079
|
}
|
|
2080
2080
|
else {
|
|
2081
|
-
left_cache = new WeakMap(
|
|
2081
|
+
left_cache = new WeakMap();
|
|
2082
2082
|
$.$mol_compare_deep_cache.set(left, left_cache);
|
|
2083
2083
|
}
|
|
2084
|
+
left_cache.set(right, true);
|
|
2084
2085
|
let result;
|
|
2085
2086
|
try {
|
|
2086
2087
|
if (!left_proto)
|
|
@@ -2232,6 +2233,20 @@ var $;
|
|
|
2232
2233
|
b['self'] = b;
|
|
2233
2234
|
$mol_assert_ok($mol_compare_deep(a, b));
|
|
2234
2235
|
},
|
|
2236
|
+
'same POJOs with cyclic reference with cache warmup'() {
|
|
2237
|
+
const obj1 = { test: 1, obj3: null };
|
|
2238
|
+
const obj1_copy = { test: 1, obj3: null };
|
|
2239
|
+
const obj2 = { test: 2, obj1 };
|
|
2240
|
+
const obj2_copy = { test: 2, obj1: obj1_copy };
|
|
2241
|
+
const obj3 = { test: 3, obj2 };
|
|
2242
|
+
const obj3_copy = { test: 3, obj2: obj2_copy };
|
|
2243
|
+
obj1.obj3 = obj3;
|
|
2244
|
+
obj1_copy.obj3 = obj3_copy;
|
|
2245
|
+
$mol_assert_not($mol_compare_deep(obj1, {}));
|
|
2246
|
+
$mol_assert_not($mol_compare_deep(obj2, {}));
|
|
2247
|
+
$mol_assert_not($mol_compare_deep(obj3, {}));
|
|
2248
|
+
$mol_assert_ok($mol_compare_deep(obj3, obj3_copy));
|
|
2249
|
+
},
|
|
2235
2250
|
'Date'() {
|
|
2236
2251
|
$mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
|
|
2237
2252
|
$mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
|