You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Node.js 12.0.0 changes how arrays with symbol properties are compared using deepEqual() #27652
Hi, it looks like Node 12 changed how arrays are compared with deepEqual(), presumably due to https://github.com/nodejs/node/pull/25008/files . Here's an example of how deepEqual() handles arrays with symbol properties:
$ ~/Workspace/libs/node-v12.0.0-linux-x64/bin/node test.js
v12.0.0
assert.js:89
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be loosely deep-equal:
[
[Symbol(foo)]: 42
]
should equal
[]
$
Is this a bug or expected behavior? If so, you should update the legacy mode deepEqual() docs, which explicitly state that symbol properties are ignored.
This was indeed an unintentional change and I missed that the array optimization currently always gets the symbol properties even though the loose equal comparison should not compare symbol properties. I'll open a PR to fix that.
Activity
targos commentedon May 11, 2019
/cc @nodejs/assert @BridgeAR
BridgeAR commentedon May 11, 2019
This was indeed an unintentional change and I missed that the array optimization currently always gets the symbol properties even though the loose equal comparison should not compare symbol properties. I'll open a PR to fix that.
assert: loose deep equal should not compare symbol properties
assert: loose deep equal should not compare symbol properties
assert: loose deep equal should not compare symbol properties