1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/collections/iterator-2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,12 @@ 1.4 +// for-of on an empty collection does not execute the loop body or modify the loop variable. 1.5 + 1.6 +function test(empty) { 1.7 + var x = 'unchanged'; 1.8 + for (x of empty) 1.9 + throw fit; 1.10 + assertEq(x, 'unchanged'); 1.11 +} 1.12 + 1.13 +test([]); 1.14 +test(new Map); 1.15 +test(new Set); 1.16 \ No newline at end of file