Bug 74452 - IndexedDB: Can't pass DOMStringList to IDBDatabase.transaction()
Summary: IndexedDB: Can't pass DOMStringList to IDBDatabase.transaction()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Bell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 15:10 PST by Joshua Bell
Modified: 2011-12-15 20:23 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.66 KB, patch)
2011-12-13 15:30 PST, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch (4.62 KB, patch)
2011-12-15 10:38 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 2011-12-13 15:10:25 PST
Sample:

indexedDB = window.indexedDB || window.webkitIndexedDB;
indexedDB.open('db-test' + String(new Date)).onsuccess = function(e) {
  var db = e.target.result;
  db.setVersion('1').onsuccess = function(e) {
    var trans = e.target.result;
    trans.oncomplete = function() { test(db); };
  };
};

function test(db) {
  var dsl = db.objectStoreNames;
  var trans = db.transaction(dsl);
}

Expected: db.transaction() succeeds with ["store"] as the scope
Actual: INVALID_ACCESS_ERR is thrown
Comment 1 Joshua Bell 2011-12-13 15:30:42 PST
Created attachment 119097 [details]
Patch
Comment 2 Joshua Bell 2011-12-13 15:33:46 PST
The code generator spits out:

  if ( ...  V8DOMStringList::HasInstance(args[0]) ... ) { ... }

And later:

  EXCEPTION_BLOCK(RefPtr<DOMStringList>, storeNames, v8ValueToWebCoreDOMStringList(MAYBE_MISSING_PARAMETER(args, 0, Mi
ssingIsUndefined)));

.. but v8ValueToWebCoreDOMStringList doesn't actually handle DOMStringList arguments. Dur.....

This worked prior to M17 because bogus first arguments to IDBDatabase.transaction() were treated as [] (empty-array) which meant "use all stores", but that functionality was removed.
Comment 3 David Grogan 2011-12-13 15:34:17 PST
Comment on attachment 119097 [details]
Patch

IDB functionality LG.  All yours, Adam.
Comment 4 Joshua Bell 2011-12-15 10:38:12 PST
Created attachment 119456 [details]
Patch
Comment 5 Joshua Bell 2011-12-15 10:38:58 PST
Comment on attachment 119456 [details]
Patch

Just removed a blank line. (DOS line endings in the layout test blinded me.)
Comment 6 Adam Barth 2011-12-15 17:29:06 PST
Comment on attachment 119456 [details]
Patch

Looks great.
Comment 7 WebKit Review Bot 2011-12-15 20:23:30 PST
Comment on attachment 119456 [details]
Patch

Clearing flags on attachment: 119456

Committed r103018: <http://trac.webkit.org/changeset/103018>
Comment 8 WebKit Review Bot 2011-12-15 20:23:35 PST
All reviewed patches have been landed.  Closing bug.