RESOLVED FIXED 28112
localStorage.key() does not return null for indicies >= localStorage.length
https://bugs.webkit.org/show_bug.cgi?id=28112
Summary localStorage.key() does not return null for indicies >= localStorage.length
Brett C.
Reported 2009-08-08 13:03:51 PDT
The W3C Web Storage spec says that for localStorage.key() (http://dev.w3.org/html5/webstorage/#dom-storage-key) null should be returned when the value passed in is equal to or greater than what localStorage.length returns (and the same obviously goes for sessionStorage). But if you do ``localStorage.key(localStorage.length)`` in Safari 4.0.2, instead of getting null you get ``Error: INDEX_SIZE_ERR: DOM Exception 1``.
Attachments
Patch v1 (10.89 KB, patch)
2009-08-10 14:43 PDT, Jeremy Orlow
beidson: review+
Jeremy Orlow
Comment 1 2009-08-10 14:43:15 PDT
Created attachment 34517 [details] Patch v1
Jeremy Orlow
Comment 2 2009-08-10 21:03:14 PDT
Sending LayoutTests/ChangeLog Sending LayoutTests/storage/domstorage/localstorage/simple-usage-expected.txt Sending LayoutTests/storage/domstorage/localstorage/simple-usage.html Sending LayoutTests/storage/domstorage/sessionstorage/simple-usage-expected.txt Sending LayoutTests/storage/domstorage/sessionstorage/simple-usage.html Sending WebCore/ChangeLog Sending WebCore/bindings/js/JSStorageCustom.cpp Sending WebCore/bindings/v8/custom/V8StorageCustom.cpp Sending WebCore/storage/Storage.cpp Sending WebCore/storage/Storage.h Sending WebCore/storage/Storage.idl Sending WebCore/storage/StorageArea.h Sending WebCore/storage/StorageAreaImpl.cpp Sending WebCore/storage/StorageAreaImpl.h Sending WebCore/storage/StorageMap.cpp Sending WebCore/storage/StorageMap.h Transmitting file data ................ Committed revision 47020. http://trac.webkit.org/changeset/47020
Note You need to log in before you can comment on or make changes to this bug.