summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/WeakMap-constructor-generator-exception.js
blob: 996b8e7c73ff0e79bda6485c5d175c81df4e5009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Iterating over the argument to WeakMap can throw. The exception is
// propagated.

load(libdir + "asserts.js");

function* data() {
    yield [{}, "XR22/Z"];
    yield [{}, "23D-BN"];
    throw "oops";
}

var it2 = data();
assertThrowsValue(() => new WeakMap(it2), "oops");