| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7f85a2c commit e07c9b8
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -546,10 +546,6 @@ An alias of [`assert.ok()`][]. | |||
| 546 | 546 | <!-- YAML | |
| 547 | 547 | added: v0.1.21 | |
| 548 | 548 | changes: | |
| 549 | - - version: REPLACEME | ||
| 550 | - pr-url: https://github.com/nodejs/node/pull/46593 | ||
| 551 | - description: Recursion now stops when either side encounters a circular | ||
| 552 | - reference. | ||
| 553 | 549 | - version: v18.0.0 | |
| 554 | 550 | pr-url: https://github.com/nodejs/node/pull/41020 | |
| 555 | 551 | description: Regular expressions lastIndex property is now compared as well. | |
@@ -621,7 +617,7 @@ are also recursively evaluated by the following rules. | |||
| 621 | 617 | * [Object wrappers][] are compared both as objects and unwrapped values. | |
| 622 | 618 | * `Object` properties are compared unordered. | |
| 623 | 619 | * [`Map`][] keys and [`Set`][] items are compared unordered. | |
| 624 | - * Recursion stops when both sides differ or either side encounters a circular | ||
| 620 | + * Recursion stops when both sides differ or both sides encounter a circular | ||
| 625 | 621 | reference. | |
| 626 | 622 | * Implementation does not test the [`[[Prototype]]`][prototype-spec] of | |
| 627 | 623 | objects. | |
@@ -731,10 +727,6 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the | |||
| 731 | 727 | <!-- YAML | |
| 732 | 728 | added: v1.2.0 | |
| 733 | 729 | changes: | |
| 734 | - - version: REPLACEME | ||
| 735 | - pr-url: https://github.com/nodejs/node/pull/46593 | ||
| 736 | - description: Recursion now stops when either side encounters a circular | ||
| 737 | - reference. | ||
| 738 | 730 | - version: v18.0.0 | |
| 739 | 731 | pr-url: https://github.com/nodejs/node/pull/41020 | |
| 740 | 732 | description: Regular expressions lastIndex property is now compared as well. | |
@@ -788,7 +780,7 @@ are recursively evaluated also by the following rules. | |||
| 788 | 780 | * [Object wrappers][] are compared both as objects and unwrapped values. | |
| 789 | 781 | * `Object` properties are compared unordered. | |
| 790 | 782 | * [`Map`][] keys and [`Set`][] items are compared unordered. | |
| 791 | - * Recursion stops when both sides differ or either side encounters a circular | ||
| 783 | + * Recursion stops when both sides differ or both sides encounter a circular | ||
| 792 | 784 | reference. | |
| 793 | 785 | * [`WeakMap`][] and [`WeakSet`][] comparison does not rely on their values. See | |
| 794 | 786 | below for further details. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -343,10 +343,7 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { | |||
| 343 | 343 | if (memos.set === undefined) { | |
| 344 | 344 | if (memos.deep === false) { | |
| 345 | 345 | if (memos.a === val1) { | |
| 346 | - return memos.b === val2; | ||
| 347 | - } | ||
| 348 | - if (memos.b === val2) { | ||
| 349 | - return false; | ||
| 346 | + if (memos.b === val2) return true; | ||
| 350 | 347 | } | |
| 351 | 348 | memos.c = val1; | |
| 352 | 349 | memos.d = val2; | |
@@ -366,12 +363,9 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { | |||
| 366 | 363 | ||
| 367 | 364 | const originalSize = set.size; | |
| 368 | 365 | set.add(val1); | |
| 369 | - if (originalSize === set.size) { | ||
| 370 | - return set.has(val2); | ||
| 371 | - } | ||
| 372 | 366 | set.add(val2); | |
| 373 | - if (originalSize === set.size - 1) { | ||
| 374 | - return false; | ||
| 367 | + if (originalSize === set.size) { | ||
| 368 | + return true; | ||
| 375 | 369 | } | |
| 376 | 370 | ||
| 377 | 371 | const areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -425,7 +425,7 @@ assertNotDeepOrStrict( | |||
| 425 | 425 | b.a = {}; | |
| 426 | 426 | b.a.a = a; | |
| 427 | 427 | ||
| 428 | - assertNotDeepOrStrict(a, b); | ||
| 428 | + assertDeepAndStrictEqual(a, b); | ||
| 429 | 429 | } | |
| 430 | 430 | ||
| 431 | 431 | { | |
@@ -435,7 +435,7 @@ assertNotDeepOrStrict( | |||
| 435 | 435 | b.a = b; | |
| 436 | 436 | const c = {}; | |
| 437 | 437 | c.a = a; | |
| 438 | - assertNotDeepOrStrict(b, c); | ||
| 438 | + assertDeepAndStrictEqual(b, c); | ||
| 439 | 439 | } | |
| 440 | 440 | ||
| 441 | 441 | { | |
@@ -445,7 +445,7 @@ assertNotDeepOrStrict( | |||
| 445 | 445 | b.add(b); | |
| 446 | 446 | const c = new Set(); | |
| 447 | 447 | c.add(a); | |
| 448 | - assertNotDeepOrStrict(b, c); | ||
| 448 | + assertDeepAndStrictEqual(b, c); | ||
| 449 | 449 | } | |
| 450 | 450 | ||
| 451 | 451 | // https://github.com/nodejs/node-v0.x-archive/pull/7178 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments