diff options
Diffstat (limited to 'js/src/tests/ecma_6/Class/newTargetGenerators.js')
-rw-r--r-- | js/src/tests/ecma_6/Class/newTargetGenerators.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/Class/newTargetGenerators.js b/js/src/tests/ecma_6/Class/newTargetGenerators.js new file mode 100644 index 000000000..614b1ab90 --- /dev/null +++ b/js/src/tests/ecma_6/Class/newTargetGenerators.js @@ -0,0 +1,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"); |