-
Notifications
You must be signed in to change notification settings - Fork 651
@std/assert/equals
considers Object.create(null)
and {}
to be equal
#6334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't get what this issue is about. The given example seems already failing. |
You're right, my steps to reproduce were incorrect. - assertEquals(Object.create(Object), Object.create(null))
+ assertEquals(Object.create(Object.prototype), Object.create(null)) |
If both objects have no properties, it makes sense to distinguish between a prototype of A note on the tests: Before #6153,
|
Not exactly. Before the change, falsy constructors were already special-cased to count as equal to I'm not sure why falsy constructors were special-cased in the first place, but I assume it was intended as an ergonomic thing. |
Describe the bug
assertEquals
checks object prototypes. However, it makes certain exceptions to keep existing tests within the repo from failing."node:assert/strict"
,"ava"
, and"uvu"
all make a distinction between null-prototype object and plain objects."node:assert"
and"chai"
don't.Steps to Reproduce
The following assertion passes:
Expected behavior
The assertion fails.
Environment
Not applicable.
The text was updated successfully, but these errors were encountered: