| function shouldBe(actual, expected) { |
| throw new Error(`bad value: ${String(actual)}`); |
| function shouldThrow(func, errorMessage) { |
| throw new Error('not thrown'); |
| if (String(error) !== errorMessage) |
| throw new Error(`bad error: ${String(error)}`); |
| shouldBe(g.next().value, a); |
| shouldBe(g.next().value, a); |
| shouldBe(g.next().value, 42); |
| shouldBe(g.next().done, true); |
| }, `TypeError: function is not a constructor (evaluating 'new a.gen()')`); |
| shouldBe(g.next().value, A); |
| shouldBe(g.next().value, A); |
| shouldBe(g.next().value, 42); |
| shouldBe(g.next().done, true); |
| let g = new A.staticGen(); |
| }, `TypeError: function is not a constructor (evaluating 'new A.staticGen()')`); |