IDB: Date objects don't work as keys or values.
https://bugs.webkit.org/show_bug.cgi?id=150743
Reviewed by Darin Adler.
Source/WebCore:
Test: storage/indexeddb/modern/date-basic.html
The combination of the autogenerated bindings with Deprecated::ScriptValue was
losing the fidelity of "Date" objects being Dates, and not just normal Objects.
This was breaking their usage as IDBKeys.
Custom binding + reworking the IDBObjectStore IDLs to use JSValue instead of ScriptValue
fixes this handily.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::add):
(WebCore::IDBClient::IDBObjectStore::put):
(WebCore::IDBClient::IDBObjectStore::putOrAdd):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:
* Modules/indexeddb/legacy/LegacyObjectStore.cpp:
(WebCore::LegacyObjectStore::add):
(WebCore::LegacyObjectStore::put):
* Modules/indexeddb/legacy/LegacyObjectStore.h:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
(WebCore::scriptValueToIDBKey):
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::putOrAdd):
(WebCore::JSIDBObjectStore::putRecord):
(WebCore::JSIDBObjectStore::add):
LayoutTests:
* storage/indexeddb/modern/date-basic-expected.txt: Added.
* storage/indexeddb/modern/date-basic.html: Added.
* storage/indexeddb/modern/get-keyrange-expected.txt:
* storage/indexeddb/modern/get-keyrange.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191850
268f45cc-cd09-0410-ab3c-
d52691b4dbfc