提交 1e7bd320 编写于 作者: A attila

8023250: Update JavaScript code in JDK for changes in iteration over Java arrays

Reviewed-by: sundar, sla
上级 b0e203ea
......@@ -1144,7 +1144,7 @@ function contains(array, code) {
} else {
for (var index in array) {
var it = array[index];
if (func(it, index, array)) {
if (func(it, String(index), array)) {
return true;
}
}
......@@ -1244,7 +1244,7 @@ function filter(array, code) {
var result = new Array();
for (var index in array) {
var it = array[index];
if (func(it, index, array, result)) {
if (func(it, String(index), array, result)) {
result[result.length] = it;
}
}
......@@ -1317,7 +1317,7 @@ function map(array, code) {
var result = new Array();
for (var index in array) {
var it = array[index];
result[result.length] = func(it, index, array, result);
result[result.length] = func(it, String(index), array, result);
}
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册