Comment by dzaima
2 days ago
This doesn't work on Firefox, as it normalizes NaNs as they're extracted from ArrayBuffers. Presumably because SpiderMonkey uses NaN-boxing itself, and thus just doesn't have any way to represent actual non-canonical NaN floats.
The spec mandates normalization of NaNs in ArrayBuffers. If other engines do not normalize, I believe it's a bug in those engines!
Chromium & Node (i.e. V8) do seem to just not normalize:
Running the following snippets:
I get on Chrome:
And on Firefox:
It looks like both implementations are buggy, Since both the DataView and buffer versions should be normalized.
https://bugzilla.mozilla.org/show_bug.cgi?id=1393085
Dammit Mozilla, first no WebGPU, now this?! /s