User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:188.8.131.52) Gecko/20061204 Firefox/184.108.40.206 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:220.127.116.11) Gecko/20061204 Firefox/18.104.22.168 The following code doesn't work (for a depth higher than 2): x=new Object(); x.y=new Object(); z.y.z=new Object(); z.y.z.t=new Object(); sessionStorage.x = x; u = sessionStorage.x.y.z; // "sessionStorage.x.y has no properties" is thrown The "inline assignments" version also exhibits the same bug, but no exception is thrown: sessionStorage.A=1 sessionStorage.A.B=2 sessionStorage.A.B.C=3 d = sessionStorage.A.B.C; // here: d == null Reproducible: Always Steps to Reproduce: See the details and/or the two test cases. Actual Results: Explained in details section Expected Results: Explained in details section Maybe the "storage" event is not properly raised... More info at: http://www.whatwg.org/specs/web-apps/current-work/#sessionstorage
Assignee: nobody → general
Component: General → DOM
Product: Firefox → Core
QA Contact: general → ian
Version: 2.0 Branch → 1.8 Branch
Per http://www.whatwg.org/specs/web-apps/current-work/#storageitem a StorageItem's value is a DOMString and no Object. -> INVALID You might want to use the following pattern to store objects as strings: sessionStorage.x = x.toSource(); u = eval(sessionStorage.x).y.z
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → INVALID
Resolution: INVALID → WORKSFORME
(In reply to comment #2) > Following the example, I'm not writing directly to "value" attribute You are: sessionStorage.key = value; (both key and value are implicitly converted to a DOMString) > so the fix you posted shouldn't be done "inside" FFox? Only if the HTML5 spec is changed accordingly - otherwise you'll want Firefox to behave the same way as other browsers implementing HTML5 to prevent confusion when doing cross-browser development.
You need to log in before you can comment on or make changes to this bug.