You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dataview comparison in ExtensiveDeepEqualByType compares the underlying buffers instead of comparing the dataviews themselves.
This means that the following dataviews are treated as different even if they represent the same data:
Both views represent the slice [0x01] but the equality test returns false because the underlying buffers are different.
Note that this behavior is not even fully consistent. If you want to treat buffer as a public property that should match in both cases, then the offset should also matter. At the moment new DataView(longBuffer, 0, 2) is equal to new DataView(2, 2) because the buffers are the same (even if the data is different due to the different offsets).
The text was updated successfully, but these errors were encountered:
Seems like this would be useful. How do you propose we make this change? We could .slice() the ArrayBuffers by the respective byteOffset and byteLength and compare the slices values?
The dataview comparison in
ExtensiveDeepEqualByType
compares the underlying buffers instead of comparing the dataviews themselves.This means that the following dataviews are treated as different even if they represent the same data:
Both views represent the slice
[0x01]
but the equality test returns false because the underlying buffers are different.Note that this behavior is not even fully consistent. If you want to treat
buffer
as a public property that should match in both cases, then the offset should also matter. At the momentnew DataView(longBuffer, 0, 2)
is equal tonew DataView(2, 2)
because the buffers are the same (even if the data is different due to the different offsets).The text was updated successfully, but these errors were encountered: