Skip to content

Commit

Permalink
fixes elm#1092
Browse files Browse the repository at this point in the history
Correctly compare encoded bytes in `==`.
  • Loading branch information
harrysarson authored and rupertlssmith committed Feb 11, 2022
1 parent 84f3889 commit 3be3731
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Elm/Kernel/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ function _Utils_eqHelp(x, y, depth, stack)
}
//*/

if (typeof DataView === "function" && x instanceof DataView) {
var length = x.byteLength;

if (y.byteLength !== length) {
return false;
}

for (var i = 0; i < length; ++i) {
if (x.getUint8(i) !== y.getUint8(i)) {
return false;
}
}
}

for (var key in x)
{
if (!_Utils_eqHelp(x[key], y[key], depth + 1, stack))
Expand Down

0 comments on commit 3be3731

Please sign in to comment.