User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:220.127.116.11) Gecko/20090715 Firefox/3.5.1
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:18.104.22.168) Gecko/20090715 Firefox/3.5.1
The W3C Web Storage spec on localStorage.key() (http://dev.w3.org/html5/webstorage/#dom-storage-key) says that when an argument equal to or greater than the number of entries is given that null should be returned. But in fact an exception is currently being raised.
Steps to Reproduce:
1. run ``localStorage.key(localStorage.length)``
2. Note the raised exception and how null is not returned as expected.
[Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"
null should be returned.
Reset product/component to something hopefully more sane.
Confirming on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20090919 Minefield/3.7a1pre
See the URL for the testcase.
This bug is still current, on Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Not time to work on this right now.
Duping forward to bug 738647, because that one has a patch.
*** This bug has been marked as a duplicate of bug 738647 ***