Closed Bug 509241 Opened 15 years ago Closed 12 years ago

localStorage.key(localStorage.length) not returning null as W3C spec says it should

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 738647

People

(Reporter: brett, Unassigned)

References

()

Details

(Keywords: html5, testcase)

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.
Component: General → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: general → general
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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: wanted1.9.2?
Keywords: html5, testcase
Version: unspecified → Trunk
Assignee: nobody → honzab.moz
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.
Assignee: honzab.moz → nobody
Duping forward to bug 738647, because that one has a patch.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.