1 2 3 4 5 6 7 8 9 10 11 12 13
// Basic for-of test with Proxy. var s = ''; var arr = ['a', 'b', 'c', 'd']; var p = new Proxy(arr, {}); // Test the same proxy twice. for (var i = 0; i < 2; i++) { var j = 0; for (var x of p) assertEq(x, arr[j++]); assertEq(j, arr.length); }