[Webkit-unassigned] [Bug 41645] New: localStorage setItem converting value argument to string before saving

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 5 20:27:43 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41645

           Summary: localStorage setItem converting value argument to
                    string before saving
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
               URL: http://dev.w3.org/html5/webstorage/#the-storage-interf
                    ace
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: david.g.hong at gmail.com


According to http://dev.w3.org/html5/webstorage/#the-storage-interface - Storage.setItem is defined this way:

setter creator void setItem(in DOMString key, in any data);

However, Safari 5 / Chrome 5 converts argument data to string before storing, thereby producing some unexpected errors. For example:

// let's store a boolean value
window.localStorage.setItem('a', true);

// typeof returns string
typeof window.localStorage.getItem('a');

// equality does not work
window.localStorage.getItem('a') == true; //evaluates to false

Is this the correct behaviour or will this be fixed? I think this is a bug?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list