Last Comment Bug 509241 - localStorage.key(localStorage.length) not returning null as W3C spec says it should
: localStorage.key(localStorage.length) not returning null as W3C spec says it ...
Status: RESOLVED DUPLICATE of bug 738647
: html5, testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
javascript:try { alert(localStorage.k...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-08 13:15 PDT by Brett C.
Modified: 2013-04-04 13:53 PDT (History)
6 users (show)
asqueella: wanted1.9.2?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Brett C. 2009-08-08 13:15:24 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) 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.

Reproducible: Always

Steps to Reproduce:
1. run ``localStorage.key(localStorage.length)``
2. Note the raised exception and how null is not returned as expected.
Actual Results:  
[Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"

Expected Results:  
null should be returned.
Comment 1 Dirkjan Ochtman (:djc) 2009-08-09 01:45:12 PDT
Reset product/component to something hopefully more sane.
Comment 2 Nickolay_Ponomarev 2009-09-19 10:41:03 PDT
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.
Comment 3 Paul van Eijden 2011-07-30 09:54:08 PDT
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
Comment 4 Honza Bambas (:mayhemer) 2012-01-18 08:34:29 PST
Not time to work on this right now.
Comment 5 :Ms2ger (⌚ UTC+1/+2) 2012-03-28 10:41:05 PDT
Duping forward to bug 738647, because that one has a patch.

*** This bug has been marked as a duplicate of bug 738647 ***

Note You need to log in before you can comment on or make changes to this bug.