assert: Check typed array view type in deepEqual
authorAnna Henningsen <sqrt@entless.org>
Sat, 26 Mar 2016 02:29:13 +0000 (03:29 +0100)
committerMyles Borins <mborins@us.ibm.com>
Mon, 11 Apr 2016 16:38:56 +0000 (12:38 -0400)
commitf949c273cd884fb066b29d7cf932fec9bc25ffda
treedcf4e15d6950c9334bf9b8109b50ec640ed5d9ba
parenta39051f5b350bb870c3650c00c1460514a41934a
assert: Check typed array view type in deepEqual

Do not convert typed arrays to `Buffer` for deepEqual since
their values may not be accurately represented by 8-bit ints.
Instead perform binary comparison of underlying `ArrayBuffer`s,
but only when the array types match.

Never apply any kind of optimization for floating-point typed
arrays since bit pattern equality is not the right kind of check
for them.

PR-URL: https://github.com/nodejs/node/pull/5910
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: https://github.com/nodejs/node/issues/5907
lib/assert.js
test/parallel/test-assert-typedarray-deepequal.js