Closed Bug 450879 Opened 16 years ago Closed 16 years ago

consistently use JSON objects instead of our own quirky string serialization

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: zeniko, Assigned: zeniko)

Details

Attachments

(1 file)

While working on bug 346337, I've stumbled over several issues with the current string serialization we use for storing text data and tab attributes. The text data serialization is going away in bug 346337, so the tab attribute serialization should just change as well, from xultab: "key=a%20value key2=next%20value" to attributes: { key: "a value", key2: "next value" } Additionally, this will make the lives of extension authors (and whoever wants direct access to this data) simpler.
Attached patch simple fixSplinter Review
Why ever we haven't used this format from the start... :(
Attachment #334096 - Flags: review?(dietrich)
Comment on attachment 334096 [details] [diff] [review] simple fix >+ for (let name in tabData.attributes) >+ tab.setAttribute(name, tabData.attributes[name]); Why not for (let [ name, value ] in tabData.attributes) tab.setAttribute(name, value) ?
Comment on attachment 334096 [details] [diff] [review] simple fix r=me
Attachment #334096 - Flags: review?(dietrich) → review+
(In reply to comment #2) > for (let [ name, value ] in tabData.attributes) Because I'm a traditionalist. ;-) Besides, your suggestion wouldn't work anyway, as tabData.attributes can be undefined and the Iterator doesn't accept that. (BTW: Your code sample is missing that very same Iterator - cf. <http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Looping_across_objects>).
Assignee: nobody → zeniko
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: