summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/proxy-3.js
blob: 1d7b84847e7ec9713a4748ec814ab4b418d6656a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// An exception thrown from a proxy trap while getting the .iterator method is propagated.

load(libdir + "asserts.js");
load(libdir + "iteration.js");

var p = new Proxy({}, {
    get(target, property) {
        if (property === Symbol.iterator)
            throw "fit";
        return undefined;
    }
});
assertThrowsValue(function () { for (var v of p) {} }, "fit");