Bug 154613
Summary: | Web Inspector: Setting serializes Infinity as null | ||
---|---|---|---|
Product: | WebKit | Reporter: | Matt Baker <mattbaker> |
Component: | Web Inspector | Assignee: | Matt Baker <mattbaker> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | bburg, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 154561 |
Matt Baker
* SUMMARY
Setting serializes Infinity as null.
According to the ECMA-262 spec (page 473 Note 4):
"Finite numbers are stringified as if by calling ToString(number). NaN and Infinity regardless of sign are represented as the String null."
There isn't a need for serializing NaN at the moment. TimelineRuler however, needs to serialize Infinity in order to persist the "nothing is selected" ruler selection state, which is represented by a selection interval of [0, Infinity).
*NOTES
This can be added by augmenting JSON.stringify in Utilities.js, or by adding a special case in WebInspector.Setting.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/24802960>
Timothy Hatcher
We could also store that "entire range selected" state as a bool and restore [0, Infinity] on load from settings.
Matt Baker
(In reply to comment #2)
> We could also store that "entire range selected" state as a bool and restore
> [0, Infinity] on load from settings.
That is a possible solution. I'll try this, as well as MAX_VALUE as an alternative to Infinity in TimelineRuler code go with the cleaner solution.
Matt Baker
Using Number.MAX_VALUE instead of Infinity solved the issue.