Element-wise equality for two array-likes: same length, and === at every
index. Covers what a leaf array field can hold — Uint8Array (blob), and
number[] / bigint[] / boolean[] / string[] — including a mixed pair
such as a Uint8Array value against a plain-array default from the schema.
Deliberately not deep: a nested (wrapper) array of messages is compared by
the generated isDefault() of its element type, which is the only code that
knows what a default element is. Equally deliberately ===, which makes NaN
unequal to itself — matching the scalar !== test, the IEEE-754 rule the rest
of the encoder follows, and the only reading under which an fp32/fp64NaN element survives the round trip rather than being omitted as "default".
There is no identity short-circuit for the same reason: elementsEqual(x, x)
has to give the same answer as elementsEqual(x, x.slice()).
Element-wise equality for two array-likes: same length, and
===at every index. Covers what a leaf array field can hold —Uint8Array(blob), andnumber[]/bigint[]/boolean[]/string[]— including a mixed pair such as aUint8Arrayvalue against a plain-array default from the schema.Deliberately not deep: a nested (wrapper) array of messages is compared by the generated
isDefault()of its element type, which is the only code that knows what a default element is. Equally deliberately===, which makesNaNunequal to itself — matching the scalar!==test, the IEEE-754 rule the rest of the encoder follows, and the only reading under which anfp32/fp64NaNelement survives the round trip rather than being omitted as "default". There is no identity short-circuit for the same reason:elementsEqual(x, x)has to give the same answer aselementsEqual(x, x.slice()).