summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/generators/yield-star-throw-htmldda.js
blob: a903da02f732066e46eb2e0ab393b3591fc7a58c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function* g(iter) {
    yield* iter;
}

var calledReturn = false;

var it = g({
    [Symbol.iterator]() {
        return this;
    },
    next() {
        return {done: false};
    },
    throw: createIsHTMLDDA(),
    return() {
        calledReturn = true;
        return {done: false};
    }
});

it.next();

assertThrowsInstanceOf(() => it.throw(""), TypeError);

assertEq(calledReturn, false);

if (typeof reportCompare === "function")
    reportCompare(0, 0);