michael@0: // for-of on an Array consults the prototype chain when it encounters a hole. michael@0: michael@0: load(libdir + "iteration.js"); michael@0: michael@0: var m = {1: 'peek'}; michael@0: var a = [0, , 2, 3]; michael@0: a.__proto__ = m; michael@0: var log = []; michael@0: Object.prototype[std_iterator] = Array.prototype[std_iterator]; michael@0: for (var x of a) michael@0: log.push(x); michael@0: assertEq(log[1], 'peek'); michael@0: assertEq(log.join(), "0,peek,2,3");