HomeWildfire Games

Refuse to serialize NaN values.

Description

Refuse to serialize NaN values.

NaN values could not be serialised safely because of the multiple possible NaN numbers.
Since NaN values are usually the result of bugs or dangerous code, it seems simpler to refuse to serialise them.

(D3205 was a safe-serialization alternative, should the need arise).

Fixes #1879

Differential Revision: https://code.wildfiregames.com/D3729

Event Timeline

Langbart raised a concern with this commit.Jun 3 2021, 7:07 AM
Langbart added a subscriber: Langbart.

I noticed a problem #6200

This commit now has outstanding concerns.Jun 3 2021, 7:07 AM
Langbart resigned from this commit.Jun 17 2021, 2:33 PM
This commit no longer requires audit.Jun 17 2021, 2:33 PM

I just had a discussion with @elexis, it would be good if we can't crash from JS (might have been a thing in the past). So it would be nice if we could reliably serialise NaN and error, or just don't serialise but do error.