Skip to content

Implement Node's deep equality algorithm for node:assert - #33068

Open
robobun wants to merge 4 commits into
mainfrom
farm/4b16d969/node-assert-deep-equal
Open

Implement Node's deep equality algorithm for node:assert#33068
robobun wants to merge 4 commits into
mainfrom
farm/4b16d969/node-assert-deep-equal

ci: retrigger

8423cd5
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 29, 2026 in 35m 11s

Code review found 1 potential issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js/internal/util/comparisons.ts:742-744 Set/Map operations not tamper-proof (Node-compat divergence)

Annotations

Check warning on line 744 in src/js/internal/util/comparisons.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Set/Map operations not tamper-proof (Node-compat divergence)

Nit: the Set/Map paths call `.size`, `.has()`, `.get()`, `.values()`, `.entries()` and `for…of` directly on the user's collections, while the rest of this file routes Date/Boolean/Number/Object/Array through module-captured prototypes via `.$call`. Node's reference uses `SetPrototypeHas`/`MapPrototypeGet`/`SetPrototypeGetSize` here, so e.g. `Set.prototype.has = () => true; assert.deepStrictEqual(new Set([1]), new Set([2]))` passes on this branch but throws in Node. `primordials.js` already expor