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

RESOLVED DUPLICATE of bug 738647

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 738647
8 years ago
4 years ago

People

(Reporter: Brett C., Unassigned)

Tracking

({html5, testcase})

Trunk
x86
Mac OS X
html5, testcase
Points:
---
Bug Flags:
wanted1.9.2 ?

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

8 years ago
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.

Updated

8 years ago
Component: General → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: general → general
Reset product/component to something hopefully more sane.

Comment 2

8 years ago
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

Comment 3

6 years ago
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
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 738647
(Assignee)

Updated

4 years ago
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.