Bug 78622 - IndexedDB: Invalid dates should not be valid keys
Summary: IndexedDB: Invalid dates should not be valid keys
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Bell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-14 11:58 PST by Joshua Bell
Modified: 2012-02-14 14:31 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.25 KB, patch)
2012-02-14 11:59 PST, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch for landing (6.42 KB, patch)
2012-02-14 13:36 PST, Joshua Bell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-02-14 11:58:37 PST
IndexedDB: Invalid dates should not be valid keys
Comment 1 Joshua Bell 2012-02-14 11:59:54 PST
Created attachment 127011 [details]
Patch
Comment 2 Joshua Bell 2012-02-14 12:02:05 PST
I noticed this special case and filed a bug against the spec:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15987

This edge case could make the IndexedDB implementation misbehave, since NaNs don't order sensibly and could make insertion and iterators sad pandas.
Comment 3 Tony Chang 2012-02-14 13:16:32 PST
Comment on attachment 127011 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=127011&action=review

> Source/WebCore/bindings/v8/IDBBindingUtilities.cpp:49
> -    if (value->IsDate())
> +    if (value->IsDate() && !isnan(value->NumberValue()))

Should this file explicitly include wtf/MthExtras.h for isnan?  It looks like this code already uses it.
Comment 4 Joshua Bell 2012-02-14 13:33:00 PST
(In reply to comment #3)
> Should this file explicitly include wtf/MthExtras.h for isnan?  It looks like this code already uses it.

Good call, adding it.
Comment 5 Joshua Bell 2012-02-14 13:36:12 PST
Created attachment 127033 [details]
Patch for landing
Comment 6 WebKit Review Bot 2012-02-14 14:31:47 PST
Comment on attachment 127033 [details]
Patch for landing

Clearing flags on attachment: 127033

Committed r107738: <http://trac.webkit.org/changeset/107738>
Comment 7 WebKit Review Bot 2012-02-14 14:31:51 PST
All reviewed patches have been landed.  Closing bug.