Skip to content

Commit 3be3731

Browse files
harrysarsonrupertlssmith
authored andcommitted
fixes elm#1092
Correctly compare encoded bytes in `==`.
1 parent 84f3889 commit 3be3731

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Elm/Kernel/Utils.js

+14
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ function _Utils_eqHelp(x, y, depth, stack)
6464
}
6565
//*/
6666

67+
if (typeof DataView === "function" && x instanceof DataView) {
68+
var length = x.byteLength;
69+
70+
if (y.byteLength !== length) {
71+
return false;
72+
}
73+
74+
for (var i = 0; i < length; ++i) {
75+
if (x.getUint8(i) !== y.getUint8(i)) {
76+
return false;
77+
}
78+
}
79+
}
80+
6781
for (var key in x)
6882
{
6983
if (!_Utils_eqHelp(x[key], y[key], depth + 1, stack))

0 commit comments

Comments
 (0)