Remove indexed property access from localStorage/sessionStorage

RESOLVED FIXED in mozilla15

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

({dev-doc-needed})

Trunk
mozilla15
dev-doc-needed
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 623405 [details] [diff] [review]
Patch v1

Currently, we allow localStorage[i] to mean localStorage.key(i). However, the spec doesn't support this, and neither does any other browser. We should either remove support or get it specced.

I'd rather remove support, because this feature means that after |localStorage[str] = foo;|, localStorage[str] will return foo iff str is not an integer (or a string representing an integer, because JS is weakly typed), and I'd suspect authors may want to use integer keys.
Attachment #623405 - Flags: review?(jonas)
(Assignee)

Updated

5 years ago
Blocks: 740357
Comment on attachment 623405 [details] [diff] [review]
Patch v1

Review of attachment 623405 [details] [diff] [review]:
-----------------------------------------------------------------

Sounds good to me given that this updates us to the spec. (As I understand it the spec changed under us).

Want to get an ok from Honza though since he's been owning this.
Attachment #623405 - Flags: review?(jonas)
Attachment #623405 - Flags: review+
Attachment #623405 - Flags: feedback?(honzab.moz)
Attachment #623405 - Flags: feedback?(honzab.moz) → feedback+
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/mozilla-central/rev/3be25330d617
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.