| function shouldBe(actual, expected) { |
| throw new Error('bad value: ' + actual); |
| function shouldThrow(func, errorMessage) { |
| throw new Error('not thrown'); |
| if (String(error) !== errorMessage) |
| throw new Error(`bad error: ${String(error)}`); |
| var global = new Function('return this')(); |
| shouldBe(g.next().value, global); |
| }, `TypeError: function is not a constructor (evaluating 'new gen()')`); |
| let g = gen.call(thisObject); |
| shouldBe(g.next().value, thisObject); |
| shouldBe(g.next().value, undefined); |
| }, `TypeError: function is not a constructor (evaluating 'new gen()')`); |
| let g = gen.call(thisObject); |
| shouldBe(g.next().value, thisObject); |