1 function shouldBe(actual, expected) {
2 if (actual !== expected)
3 throw new Error('bad value: ' + actual);
6 function shouldThrow(func, errorMessage) {
7 var errorThrown = false;
16 throw new Error('not thrown');
17 if (String(error) !== errorMessage)
18 throw new Error(`bad error: ${String(error)}`);
22 var global = new Function('return this')();
31 shouldBe(g.next().value, global);
37 }, `ReferenceError: Cannot access uninitialized variable.`);
41 let g = gen.call(thisObject);
42 shouldBe(g.next().value, thisObject);
54 shouldBe(g.next().value, undefined);
60 }, `ReferenceError: Cannot access uninitialized variable.`);
64 let g = gen.call(thisObject);
65 shouldBe(g.next().value, thisObject);