summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/proxy-1.js
blob: abf5a31ff7103fec9d0f16ecd3f96801ae917be1 (plain)
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);
}