Bug 15987 - [IndexedDB] Invalid dates should not be valid keys
[IndexedDB] Invalid dates should not be valid keys
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API
unspecified
All All
: P2 normal
: ---
Assigned To: Eliot Graff
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-14 19:45 UTC by Joshua Bell
Modified: 2012-03-02 16:19 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-02-14 19:45:32 UTC
Section 3.1.3 Keys:

"... A value is said to be a valid key if it is one of the following types: Array JavaScript objects [ECMA-262], DOMString [WEBIDL], Date [ECMA-262] or float [WEBIDL]. ... Additionally, if the value is of type float, it is only a valid key if it is not NaN. Conforming user agents must support all valid keys as keys."

Just as NaN floats are not valid keys, invalid dates - i.e. dates where the internal double (revealed by date.valueOf()) is NaN - should not be considered valid keys as these cannot be "compared to other Date values chronologically"
Comment 1 Jonas Sicking 2012-02-15 02:51:47 UTC
Agreed.
Comment 2 Odin Hørthe Omdal 2012-02-28 18:14:40 UTC
I don't know if it's really needed, but for what it's worth this totally makes sense and of course I agree. ;-)
Comment 3 Jonas Sicking 2012-03-02 16:19:40 UTC
Fixed