rm push/pop
This commit is contained in:
@@ -2918,7 +2918,7 @@ return {
|
||||
test_arrfor_with_index: function() {
|
||||
var arr = ["a", "b", "c"]
|
||||
var indices = []
|
||||
arrfor(arr, (x, i) => { push(indices, i) })
|
||||
arrfor(arr, (x, i) => { indices[] = i })
|
||||
if (indices[0] != 0 || indices[2] != 2) return "arrfor with index failed"
|
||||
},
|
||||
|
||||
@@ -2931,7 +2931,7 @@ return {
|
||||
test_arrfor_mutation: function() {
|
||||
var arr = [1, 2, 3]
|
||||
var results = []
|
||||
arrfor(arr, x => { push(results, x * 2) })
|
||||
arrfor(arr, x => { results[] = x * 2 })
|
||||
if (results[0] != 2 || results[1] != 4 || results[2] != 6) return "arrfor mutation failed"
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user