sessionStorage saves numbers as objects that convert to NaN

RESOLVED DUPLICATE of bug 455070

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 455070
11 years ago
10 years ago

People

(Reporter: tavin.cole, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070801 Firefox/2.0.0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070801 Firefox/2.0.0.6

sessionStorage.foo = 123;
dump(Number(sessionStorage.foo));             // NaN
dump(Number(sessionStorage.foo.valueOf()));   // NaN
dump(Number(String(sessionStorage.foo)));     // 123
dump(Number(sessionStorage.foo.toString()));  // 123


Reproducible: Always

Comment 1

10 years ago
sessionStorage.foo doesn't return a string (as per the spec) but a nsIDOMStorageItem. So |Number(sessionStorage.foo.value) == 123| until bug 455070 is fixed.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 455070
You need to log in before you can comment on or make changes to this bug.