A bug in Array.prototype.sort
Open
es2021
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 859
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 3
Description
Hermes version: 0.12.0
OS version (if any): ubuntu20.04
## Bug Description
The following code should print a sorted array but hermes didn't sort it.
## Testcase:
```
function foo1() {
foo2.prototype = arguments;
new foo2();
}
function foo2() {
var x = Array.prototype.sort.call(this);
for (var i = 0; i < x.length; i++) {
print(x[i]);
}
}
foo1(3,2,4,1);
```
## Output
3
2
4
1
## The Expected Behavior
1
2
3
4
Contributor guide
Assessment
This issue has not been assessed yet.