summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/Class/newTargetGenerators.js
blob: 614b1ab9081b60b5be311a7051038c622d2fd606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function *generatorNewTarget(expected) {
    assertEq(new.target, expected);
    assertEq(eval('new.target'), expected);
    assertEq((() => new.target)(), expected);
    yield (() => new.target);
}

const ITERATIONS = 25;

for (let i = 0; i < ITERATIONS; i++)
    assertEq(generatorNewTarget(undefined).next().value(), undefined);

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