chakra-core / chakra-core/ChakraCore
Enumeration order incorrect with deletes
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
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 │ │
├─────────────────────┼───────────────────┤
│ JavaScriptCore │ │
│ 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).
Contributor guide
Assessment
This issue has not been assessed yet.