GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — assert: fix loose deepEqual map comparison · nodejs/node@7fb8d31

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/util
    • comparisons.js
  • test/parallel
    • test-assert-deep.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/util/comparisons.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/comparisons.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,7 @@ function mapMightHaveLoosePrim(a, b, prim, item, memo) {
416416
!innerDeepEqual(item, curB, false, memo)) {
417417
return false;
418418
}
419-
const curA = a.get(altValue);
420-
return curA === undefined && a.has(altValue) ||
421-
innerDeepEqual(item, curA, false, memo);
419+
return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);
422420
}
423421

424422
function setEquiv(a, b, strict, memo) {
Collapse file

‎test/parallel/test-assert-deep.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert-deep.js
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ assertOnlyDeepEqual(
394394
new Map([[1, {}]]),
395395
new Map([[true, {}]])
396396
);
397+
assertOnlyDeepEqual(
398+
new Map([[undefined, true]]),
399+
new Map([[null, true]])
400+
);
401+
assertNotDeepOrStrict(
402+
new Map([[undefined, true]]),
403+
new Map([[true, true]])
404+
);
397405

398406
// GH-6416. Make sure circular refs don't throw.
399407
{

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.