Skip to content

assert: deepEqual inconsistencies #14441

@BridgeAR

Description

@BridgeAR
  • Version: 8.1.0 - 8.x.x
  • Subsystem: assert

Seems like #13318 introduced a regression where deep equal objects are now failing.

Two small test cases:

// First
// (This worked with 8.0.0 and before)
const a = {}
const b = {}
a.a = a
b.a = {}
b.a.a = a
assert.deepEqual(b, a) // ok
assert.deepEqual(a, b) // fails

// Second
// (This lead to a RangeError before the mentioned PR)
const a = new Set()
const b = new Set()
const c = new Set()
a.add(a)
b.add(b)
c.add(a)
assert.deepEqual(c, b) // ok
assert.deepEqual(b, c) // fails

I am not sure if I find the time to look into it in the next few days, so I opened the issue about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    assertIssues and PRs related to the assert subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions