Skip to content

Commit f406183

Browse files
committed
assert: support Float16Array in loose deep equality checks
1 parent e61937b commit f406183

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/util/comparisons.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const {
4444
isBooleanObject,
4545
isBigIntObject,
4646
isSymbolObject,
47+
isFloat16Array,
4748
isFloat32Array,
4849
isFloat64Array,
4950
isKeyObject,
@@ -245,7 +246,8 @@ function objectComparisonStart(val1, val2, mode, memos) {
245246
if (!isPartialArrayBufferView(val1, val2)) {
246247
return false;
247248
}
248-
} else if (mode === kLoose && (isFloat32Array(val1) || isFloat64Array(val1))) {
249+
} else if (mode === kLoose &&
250+
(isFloat16Array(val1) || isFloat32Array(val1) || isFloat64Array(val1))) {
249251
if (!areSimilarFloatArrays(val1, val2)) {
250252
return false;
251253
}

0 commit comments

Comments
 (0)