This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15987 - [IndexedDB] Invalid dates should not be valid keys
Summary: [IndexedDB] Invalid dates should not be valid keys
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Eliot Graff
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2012-02-14 19:45 UTC by Joshua Bell
Modified: 2012-03-02 16:19 UTC (History)
6 users (show)

See Also:


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 (Not reading bugmail) 2012-02-15 02:51:47 UTC
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 (Not reading bugmail) 2012-03-02 16:19:40 UTC