All commands given by a player are stored as a stringified JSON in the replay. As per ECMA definition JSON.stringify removes any non-stringifiable entries from the objects, i.e., undefined, symbols and functions are removed. This can lead to an OOS on replay as found by testing in D368: what happened I tried passing undefined in a rallypoint order. Rallypoint orders are stored and thus in the actual game there was an undefined entry, while in the replay there was not.
Simply replacing the order with a JSON.parse(JSON.stringify()) is not good since on the JS side one might not know this (even comments won't help) and then a reader might see things removed ``randomly''. Here, I recursively test for unstringifiable entries and error out. Don't like this approach either, since it assumes a certain form of the commands. I rather be erroring out from the stringify function in cpp itself (using some replacer), but my SM knowledge won't let me.
Fix a mistake in AutoFormation from rP24480.