-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Milestone
Description
let obj = {x: 1, y: 2};
obj.p1 = 1;
obj.p2 = 2;
delete obj.p1;
obj.p1 = 1;
let str = '';
for (prop in obj) {
str += '<' + prop + '> ';
}
print(str);
┌─────────────────────┬───────────────────┐
│ Chakra │ <x> <y> <p1> <p2> │
├─────────────────────┼───────────────────┤
│ JavaScriptCore │ <x> <y> <p2> <p1> │
│ SpiderMonkey │ │
│ V8 │ │
└─────────────────────┴───────────────────┘
JSC, SM, and V8 have the proper behavior here. The spec requires that own properties are enumerated in order of creation. In the example above, p1 is the last property created and so should be last (the fact that it existed before is not relevant).