Bug 63087 - IndexedDB: IDBObjectStore methods should throw TypeError if required arguments are missing
Summary: IndexedDB: IDBObjectStore methods should throw TypeError if required argument...
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-21 12:45 PDT by Mark Pilgrim (Google)
Modified: 2011-06-21 14:20 PDT (History)
6 users (show)

See Also:


Attachments
Patch (6.09 KB, patch)
2011-06-21 12:48 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Pilgrim (Google) 2011-06-21 12:45:12 PDT
http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStore lists required arguments to put(), add(), delete(), get(), createIndex(), index(), and deleteIndex(). As per the WebIDL spec, calling functions with missing required arguments should throw a TypeError. This test calls these functions with no arguments, or with too few arguments, to see what happens.

Expected behavior: throw TypeError
Actual behavior: no exception thrown

Patch included. The fix is to remove the LegacyDefaultOptionalArguments flag from IDBObjectStore.idl, which will force the code generator to check for required arguments and throw TypeError when they are missing.
Comment 1 Mark Pilgrim (Google) 2011-06-21 12:48:13 PDT
Created attachment 98045 [details]
Patch
Comment 2 Adam Barth 2011-06-21 13:45:34 PDT
Comment on attachment 98045 [details]
Patch

These patches are so beautiful.  Thanks!
Comment 3 WebKit Review Bot 2011-06-21 14:20:27 PDT
Comment on attachment 98045 [details]
Patch

Clearing flags on attachment: 98045

Committed r89383: <http://trac.webkit.org/changeset/89383>
Comment 4 WebKit Review Bot 2011-06-21 14:20:32 PDT
All reviewed patches have been landed.  Closing bug.