1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00

Fix: Array.prototype.sort.length = 1

This commit is contained in:
Robert Krimen 2014-01-22 20:46:15 -08:00
parent 5e8cb6296e
commit 7970552164
3 changed files with 5 additions and 2 deletions

View File

@ -324,6 +324,9 @@ func TestArray_sort(t *testing.T) {
test("mno", "0,1")
test("pqr", "-10,0.05,1,100,401,5,72,8")
test("stu", "-10,0.05,1,5,8,72,100,401")
test(`
[ Array.prototype.sort.length ];
`, "1")
}
func TestArray_isArray(t *testing.T) {

2
inline
View File

@ -237,7 +237,7 @@ sub newContext {
"slice", 2,
"unshift", 1,
"reverse", 0,
"sort", 0,
"sort", 1,
"indexOf", 1,
"lastIndexOf", 1,
"every", 1,

View File

@ -1082,7 +1082,7 @@ func _newContext(runtime *_runtime) {
mode: 0,
value: Value{
_valueType: valueNumber,
value: 0,
value: 1,
},
},
},