Closed Bug 754553 Opened 12 years ago Closed 12 years ago

Remove indexed property access from localStorage/sessionStorage

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

Attached patch Patch v1Splinter Review
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)
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+
https://hg.mozilla.org/mozilla-central/rev/3be25330d617
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: