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
7.4. For all other Object pairs, including Array objects, equivalence is determined by having the same number of owned properties (as verified with Object.prototype.hasOwnProperty.call), the same set of keys (although not necessarily the same order), equivalent values for every corresponding key, and an identical "prototype" property.
obviously, it had to be __proto__, [[Prototype]] or something like this
changing this behaviour breaks 3 tests
Activity
vkurchatkin commentedon Jan 27, 2015
see nodejs/node-v0.x-archive#4523
it's a bug in CommonJS: http://wiki.commonjs.org/wiki/Unit_Testing/1.0
obviously, it had to be
__proto__,[[Prototype]]or something like thischanging this behaviour breaks 3 tests
/cc @iojs/owners
bnoordhuis commentedon Jan 27, 2015
I'm alright with fixing it.
assert.deepEqual({}, [])doesn't throw. That's clearly a bug.fundon commentedon Jan 27, 2015
@vkurchatkin thanks, great work.
assert: check object prototype in `deepEqual`
assert: introduce `deepStrictEqual`
vkurchatkin commentedon Feb 9, 2015
you can use
deepStrictEqualintroduced in 3f473ef, which compares prototypes using===fundon commentedon Feb 9, 2015
Thanks, great.
jokeyrhyme commentedon Mar 3, 2015
I just noticed that this does NOT throw:
Weird.
vkurchatkin commentedon Mar 4, 2015
@jokeyrhyme use
deepStrictEqual