-
Notifications
You must be signed in to change notification settings - Fork 150
Native stringify is not being used (at all!) in Firefox due to a (Fx) bug in date serialization #65
Comments
Ouch; thanks for bringing this up! We can probably use a custom replacement function to serialize extended dates if the |
👍 Sounds good to me. |
+1 from here too. I'd highlight the believe that not using the native stringify in Firefox at all currently seems a high cost to pay for such a subtle - although legitimate and already identified/reported - issue and likely rarely used feature - serializing dates in ISO format is somehow recent, at least as a standard; also extended dates seem to be used in highly specific circumstances (like in "Ship's Log, Stardate 52152.6. [...]", still I'm throwing a "less than 1%" of users/use-cases). I'd even hint towards using the custom function in case any of the extended date tests fail: that would further help covering a few few more broken implementation, guessing from the documentation. |
A few tests showed that, in order to workaround the current behavior (but stop being extended date compliant - use with care!) for current Firefox versions (tested with 32.01 and 35.0a1), one may disable (comment out) the following lines:
For disabling all extended date checks and, as stated in previous comment, further broaden support for other broken browser versions when extended date support is not in use, then the following lines may be disabled as well:
It might be nice, IMO, to have some sort of preference for disabling extended date support, as it involves a few operations during start-up and also seems to hold a minor extra overhead during serialization/interpretation. |
Thanks for the report, I’ll work on this in a few weeks’ time (currently busy with exams). What I think we’ll do is check for date support separately, since that has many bugs across browsers. If the environment has buggy date serialisation support, but an otherwise working native JSON.stringify implementation, we’ll use the native implementation with a callback to ensure proper date serialisation. |
@D10: Sounds like a a good approach, IMO! |
After doing some thinking, I've realized that using a custom replacement function is not going to work. If the user specifies an array of property names to stringify, it would be impossible to use a replacement function while allowing filtering of properties from the array. The only solution left would be to overwrite the |
Ping? ;) @kitcambridge |
Ping? |
@kitcambridge not too sure what you mean here. |
@D10 I meant we could have our I think another alternative is to recursively copy TL;DR: Overriding |
@kitcambridge I’m quite busy now, do you think you could finish up the |
@D10 Sure thing; I've been really busy, too. 😄 I'll try to squeeze it in before the new year; otherwise, 4.0 will be our first 2015 release. |
Due to Firefox bug 730831, Firefox is currently causing the date test to fail and, therefore, always triggering the script-based stringify instead of the native implementation.
Although this was already triaged to be a Firefox issue, this was created in order to:
// Firefox misses the positive sign - see http://bugzil.la/730831
The text was updated successfully, but these errors were encountered: