blob: 602f8a2c62cdba90e8d037328a7ffe21e4cdf968 [file] [log] [blame]
function assert(b) {
if (!b)
throw new Error;
}
const originalLength = 10000;
let arr = new Proxy([], {
has(...args) {
assert(parseInt(args[1]) < originalLength);
assert(args[0].length - 10 === originalLength);
return Reflect.has(...args);
}
});
for (var i = 0; i < originalLength; i++)
arr[i] = [];
arr.indexOf(new Object(), {
valueOf: function () {
arr.length += 10;
return 0;
}
});