id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,phab_field 1879,Reliably serialize NaN values,historic_bruno,wraitii,"In #1828, it was discovered the cause of serialization test failure was Spidermonkey using different values internally for `NaN`. According to [http://www.ecma-international.org/publications/standards/Ecma-262.htm ECMAScript-262], there is only a single `NaN` value which can have different internal representation depending on the implementation. Because this might vary on different systems and even the same system in JIT vs. non-JIT paths, we should probably canonize it when serializing so it doesn't cause an OOS or serialization test failure. Related problem: the debug serializer doesn't handle `NaN` or `Infinity`, so a simple text diff won't reveal these errors. For floating-point values in the engine, we can fix that by completing the [source:/ps/trunk/source/simulation2/serialization/DebugSerializer.cpp#L37 canonfloat()] function. For script vals, it's a bit more difficult because we use `JS_Stringify`, which per the JSON spec doesn't allow `NaN` or `Infinity` (replacing them with `null`).",defect,reopened,Must Have,Backlog,Core engine,,,,Phab:D3205