michael@0: // for-of on a slow Array consults the prototype chain when it encounters a hole. michael@0: michael@0: var a = [0, , , 3]; michael@0: a.slow = true; michael@0: Object.prototype[1] = 'peek1'; michael@0: Array.prototype[2] = 'peek2'; michael@0: michael@0: var log = []; michael@0: for (var x of a) michael@0: log.push(x); michael@0: assertEq(log[1], 'peek1'); michael@0: assertEq(log[2], 'peek2'); michael@0: assertEq(log.join(), "0,peek1,peek2,3");