Opened 9 years ago
Last modified 8 years ago
#3375 new defect
Objects indexed by integers get reordered upon serialization
Reported by: | Itms | Owned by: | |
---|---|---|---|
Priority: | Must Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
Attachments (2)
Change History (7)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
by , 9 years ago
by , 9 years ago
Attachment: | commands.txt added |
---|
comment:3 by , 9 years ago
Here is a test that reproduces the problem: http://pastebin.com/A4RCbQzC
comment:4 by , 9 years ago
I suspect this has something to do with adding elements in a way that produces something that is seen by SpiderMonkey as a dense subset of some elements, thus triggering the first https://mxr.mozilla.org/mozilla-central/source/js/src/jsiter.cpp#141 loop, which ends up reordering part of the properties of the object.
I'm not entirely sure if we can prevent that, and also not why the original state does not have the reordering. We should possibly try not to use integer indexed identifiers in objects, but use Map instead.
Note:
See TracTickets
for help on using tickets.
In 16929: