[ARM,MIPS] Skip slow tests
[WebKit-https.git] / JSTests / stress / generator-function-constructor-is-subclassible.js
1 function shouldBe(actual, expected) {
2     if (actual !== expected)
3         throw new Error('bad value: ' + actual);
4 }
5
6 var GeneratorFunction = (function *() { }).constructor;
7
8 class DerivedGeneratorFunction extends GeneratorFunction {
9     constructor()
10     {
11         super("yield 42");
12     }
13
14     hello()
15     {
16         return 50;
17     }
18 }
19
20 let DerivedGenerator = new DerivedGeneratorFunction();
21 shouldBe(DerivedGenerator.__proto__, DerivedGeneratorFunction.prototype);
22 shouldBe(DerivedGenerator.hello(), 50);
23 let gen = DerivedGenerator();
24 shouldBe(gen.next().value, 42);