IndexedDB: IDBIndex.get/getKey should yield undefined, not an error
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 10:51:55 +0000 (10:51 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 10:51:55 +0000 (10:51 +0000)
commit35882ae6bcb818d5543832c50affaee2b1a1b663
tree3abea2ed18bfaf68aadac144c16f5582152f0948
parent2b981382e2daef493f9f65710a32a2dc16a25bc1
IndexedDB: IDBIndex.get/getKey should yield undefined, not an error
https://bugs.webkit.org/show_bug.cgi?id=76116

Source/WebCore:

Pass an undefined value (for IDBIndex.get()) or a null key
(for IDBIndex.getKey()) back as the result, rather than raising
an exception.

Reviewed by Adam Barth.

Tests: storage/indexeddb/index-basics.html
       storage/indexeddb/cursor-index-delete.html
       storage/indexeddb/duplicates.html

* storage/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::getInternal):
* storage/IDBRequest.cpp:
(WebCore::IDBRequest::onSuccess):

LayoutTests:

Reviewed by Adam Barth.

* storage/indexeddb/cursor-index-delete-expected.txt:
* storage/indexeddb/cursor-index-delete.html:
* storage/indexeddb/duplicates-expected.txt:
* storage/indexeddb/duplicates.html:
* storage/indexeddb/index-basics-expected.txt:
* storage/indexeddb/index-basics.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
LayoutTests/storage/indexeddb/cursor-index-delete.html
LayoutTests/storage/indexeddb/duplicates-expected.txt
LayoutTests/storage/indexeddb/duplicates.html
LayoutTests/storage/indexeddb/index-basics-expected.txt
LayoutTests/storage/indexeddb/index-basics.html
Source/WebCore/ChangeLog
Source/WebCore/storage/IDBIndexBackendImpl.cpp
Source/WebCore/storage/IDBRequest.cpp