Commit 421860fb authored by David Votrubec's avatar David Votrubec

fixed bug in example 07 | Babel regenerator could not compile stand-alone...

fixed bug in example 07 | Babel regenerator could not compile stand-alone yield. Seems that it always requires a value to be yielded, even when the value is undefined
parent 7934f872
......@@ -4,7 +4,9 @@
function *generator() {
console.log('I have started');
yield; // we yield nothing, so the returned value is undefined
// It should be valid to just 'yield', but for some reason 'regenerator:all' does not like it
yield undefined; // we yield nothing, so the returned value is undefined
var a = yield "some value";
console.log('a is now ', a); // 'a' will contain value passed into generator when it was resumed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment