Commit f949c27
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: #5910
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: #59071 parent a39051f commit f949c27Copy full SHA for f949c27
File tree
Expand file treeCollapse file tree
2 files changed
+27
-6
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+27
-6
lines changedOpen diff view settings
Collapse file
+13-4Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
| 32 | + |
32 | 33 | |
33 | 34 | |
34 | 35 | |
| ||
170 | 171 | |
171 | 172 | |
172 | 173 | |
173 | | - |
174 | | - |
175 | | - |
176 | | - |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
177 | 186 | |
178 | 187 | |
179 | 188 | |
|
Collapse file
test/parallel/test-assert-typedarray-deepequal.js
Copy file name to clipboardExpand all lines: test/parallel/test-assert-typedarray-deepequal.js+14-2Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
20 | 20 | |
21 | 21 | |
22 | 22 | |
23 | | - |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
24 | 29 | |
25 | 30 | |
26 | 31 | |
27 | 32 | |
28 | 33 | |
29 | | - |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
30 | 42 | |
31 | 43 | |
32 | 44 | |
|
0 commit comments