blob: 4f7ef485a087d763b1a95f8f86a76b789106e946 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
function maybeSetLength(arr, b) {
with(this) {};
if (b)
arr.length = 0x7fffffff;
}
function test() {
var arr = [];
for (var i=0; i<2000; i++) {
maybeSetLength(arr, i > 1500);
var res = arr.push(2);
assertEq(res, i > 1500 ? 0x80000000 : i + 1);
}
}
test();
|