Title: assert.deepStrictEqual / util.isDeepStrictEqual throw TypeError on Maps with null keys · Issue #64433 · nodejs/node · GitHub
Open Graph Title: assert.deepStrictEqual / util.isDeepStrictEqual throw TypeError on Maps with null keys · Issue #64433 · nodejs/node
X Title: assert.deepStrictEqual / util.isDeepStrictEqual throw TypeError on Maps with null keys · Issue #64433 · nodejs/node
Description: Version v24.13.1, v26.4.0 (reproduced on both) Platform Darwin 24.x arm64 (also reproduces on Linux x64) Subsystem assert, util What steps will reproduce the bug? const { isDeepStrictEqual } = require('node:util'); isDeepStrictEqual( new...
Open Graph Description: Version v24.13.1, v26.4.0 (reproduced on both) Platform Darwin 24.x arm64 (also reproduces on Linux x64) Subsystem assert, util What steps will reproduce the bug? const { isDeepStrictEqual } = requ...
X Description: Version v24.13.1, v26.4.0 (reproduced on both) Platform Darwin 24.x arm64 (also reproduces on Linux x64) Subsystem assert, util What steps will reproduce the bug? const { isDeepStrictEqual } = requ...
Opengraph URL: https://github.com/nodejs/node/issues/64433
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"assert.deepStrictEqual / util.isDeepStrictEqual throw TypeError on Maps with null keys","articleBody":"### Version\n\nv24.13.1, v26.4.0 (reproduced on both)\n\n### Platform\n\n```text\nDarwin 24.x arm64 (also reproduces on Linux x64)\n```\n\n### Subsystem\n\nassert, util\n\n### What steps will reproduce the bug?\n\n```js\nconst { isDeepStrictEqual } = require('node:util');\n\nisDeepStrictEqual(\n new Map([[null, { v: 1 }], [{ a: 1 }, 1]]),\n new Map([[{ b: 2 }, { v: 1 }], [{ a: 1 }, 1]])\n);\n// TypeError: Cannot read properties of null (reading 'constructor')\n```\n\nThe same input crashes `assert.deepStrictEqual` and `assert.notDeepStrictEqual`\nwith the same TypeError (instead of an `AssertionError` / clean pass).\n\nThe triggering shape: one Map has a `null` key whose value is an object, the\nother Map lacks a `null` key but contains an object key with a deeply-equal\nvalue, plus at least one additional entry. Simpler null-key cases (primitive\nvalues, or no other entries) return correctly, so the crash is in the\nsecond-pass unordered key matching.\n\n### How often does it reproduce? Is there a required condition?\n\nDeterministic.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`isDeepStrictEqual` returns `false`; `assert.deepStrictEqual` throws\n`AssertionError`; `assert.notDeepStrictEqual` passes. A comparison predicate\nshould never throw a `TypeError` on valid inputs.\n\n### What do you see instead?\n\n```text\nTypeError: Cannot read properties of null (reading 'constructor')\n```\n\n### Additional information\n\nLikely cause: in the fallback pass that pairs non-identical Map keys by deep\nequality, keys with `typeof key === 'object'` are collected for pairwise\ncomparison, and `null` (also `typeof 'object'`) reaches a code path that reads\n`key.constructor` without a null guard.\n\nFound by differential fuzzing of deep-equality implementations; happy to\nprovide more failing inputs (they all share the shape above).\n","author":{"url":"https://github.com/XyraSinclair","@type":"Person","name":"XyraSinclair"},"datePublished":"2026-07-11T23:26:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/64433/node/issues/64433"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d0d5f55f-d020-c604-da8d-97e4cc9004a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C044:1831C9:AF8657:EE96E5:6A62F43F |
| html-safe-nonce | e949995b196deda769bc114cb909bc0833a3829b4a7e2961cd12b8890e87a069 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDQ0OjE4MzFDOTpBRjg2NTc6RUU5NkU1OjZBNjJGNDNGIiwidmlzaXRvcl9pZCI6IjMxODAwMzUzMjQzNzE5ODk1NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 62d213b6904b53fa251c492e0b420d9845b4be91ab5f0a7e16b5d3adf3bed0fb |
| hovercard-subject-tag | issue:4864574653 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64433/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bbee22a59cd02c8ab074179b0508bc4871c348eb2bc8014fb9587435ae3d6dc7/nodejs/node/issues/64433 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bbee22a59cd02c8ab074179b0508bc4871c348eb2bc8014fb9587435ae3d6dc7/nodejs/node/issues/64433 |
| og:image:alt | Version v24.13.1, v26.4.0 (reproduced on both) Platform Darwin 24.x arm64 (also reproduces on Linux x64) Subsystem assert, util What steps will reproduce the bug? const { isDeepStrictEqual } = requ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | XyraSinclair |
| hostname | github.com |
| expected-hostname | github.com |
| None | b415018e190e73858133ddcaa36acce7b3f3572fe54dda84bd3b21a6ec714c30 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 22f98521e99f504294ab0812b66104d50eb75a70 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width