Skip to content

Conversation

@43081j
Copy link
Contributor

@43081j 43081j commented Jan 3, 2026

Fixes #1705.

Basically there's a bug where { a: 5, b: 6} and keys(['a', 'a'])
will pass because we're incorrectly assuming the key count equalling the
actual key count must mean it has all of them.

This fixes it by using a Set (widely available since node 0.x).

Fixes #1705.

Basically there's a bug where `{ a: 5, b: 6}` and `keys(['a', 'a'])`
will pass because we're incorrectly assuming the key count equalling the
actual key count must mean it has all of them.

This fixes it by using a `Set` (widely available since node 0.x).
@43081j 43081j requested a review from a team as a code owner January 3, 2026 14:04
Copy link
Member

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@43081j 43081j merged commit 8bb3a93 into main Jan 3, 2026
6 checks passed
@43081j 43081j deleted the unique-all-keys branch January 3, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assert.hasAllKeys incorrectly assumes expected keys do not contain duplicates

3 participants