michael@0: // for-of on an empty collection does not execute the loop body or modify the loop variable. michael@0: michael@0: function test(empty) { michael@0: var x = 'unchanged'; michael@0: for (x of empty) michael@0: throw fit; michael@0: assertEq(x, 'unchanged'); michael@0: } michael@0: michael@0: test([]); michael@0: test(new Map); michael@0: test(new Set);