This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6814 - return undefined for nonexistent keys rather than null
Summary: return undefined for nonexistent keys rather than null
Status: RESOLVED NEEDSINFO
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Web Storage (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-15 14:42 UTC by Anne
Modified: 2010-05-06 08:42 UTC (History)
0 users

See Also:


Attachments

Description Anne 2009-04-15 14:42:56 UTC
Since two out of three implementations of localStorage were unable to read the specification properly we have the unique (harharhar) opportunity to make the specification more in line with how ECMAScript works.

I.e. return undefined for nonexistent storage keys rather than null.
Comment 1 Ian 'Hixie' Hickson 2009-04-15 22:56:10 UTC
The spec already says that Storage.missing should return undefined (see WebIDL). Are you saying you want Storage.getItem('missing') to also return undefined?
Comment 2 Anne 2009-04-16 10:09:37 UTC
I would have much preferred that, yes. Seems too late now.