Bug 51193 - IndexedDB: Support Date objects as keys.
Summary: IndexedDB: Support Date objects as keys.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Hans Wennborg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 09:28 PST by Hans Wennborg
Modified: 2010-12-17 07:11 PST (History)
2 users (show)

See Also:


Attachments
Patch (21.14 KB, patch)
2010-12-16 09:47 PST, Hans Wennborg
no flags Details | Formatted Diff | Diff
Patch (21.88 KB, patch)
2010-12-17 04:45 PST, Hans Wennborg
jorlow: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Wennborg 2010-12-16 09:28:53 PST
IndexedDB: Support Date objects as keys.
Comment 1 Hans Wennborg 2010-12-16 09:47:12 PST
Created attachment 76777 [details]
Patch
Comment 2 Jeremy Orlow 2010-12-16 10:12:31 PST
Comment on attachment 76777 [details]
Patch

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

> LayoutTests/storage/indexeddb/objectstore-basics.html:165
> +    result = evalAndLog("store.add({x: new Date(), y: 'value'}, 'key')");

Maybe test passing in a specific date and verify it comes out as expected?

> WebCore/storage/IDBKey.h:43
> +        IDBKey* idbKey = new IDBKey();

Adopt it right away and store it in a ref ptr.  .release() in the return
Comment 3 Hans Wennborg 2010-12-17 04:45:28 PST
(In reply to comment #2)
> (From update of attachment 76777 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=76777&action=review
> 
> > LayoutTests/storage/indexeddb/objectstore-basics.html:165
> > +    result = evalAndLog("store.add({x: new Date(), y: 'value'}, 'key')");
> 
> Maybe test passing in a specific date and verify it comes out as expected?
Done (but doing it for the case where we use a Date as a key explicitly.)

> 
> > WebCore/storage/IDBKey.h:43
> > +        IDBKey* idbKey = new IDBKey();
> 
> Adopt it right away and store it in a ref ptr.  .release() in the return
Done.
Comment 4 Hans Wennborg 2010-12-17 04:45:56 PST
Created attachment 76868 [details]
Patch
Comment 5 Jeremy Orlow 2010-12-17 07:03:36 PST
Comment on attachment 76868 [details]
Patch

r=me
Comment 6 Hans Wennborg 2010-12-17 07:11:08 PST
Committed r74266: <http://trac.webkit.org/changeset/74266>