lumpy-turnips / minty

Step by step visualization of node processess
MIT License
196 stars 6 forks source link

Generator Functions aren't yielding output when wrapped #55

Closed juniorbird closed 8 years ago

juniorbird commented 8 years ago

Generator functions when minty.wrapped yield undefined

Example:

const minty = require('minty');

function* fooMaker(bar) {
  yield bar * 2;
  yield* fooMaker(bar);
}

var one = fooMaker(2);
console.log(one.next().value);
console.log(one.next().value);
console.log(one.next().value);

var two = minty.wrap(fooMaker);
console.log(two(2));

/* returns 
{}
4
4
4
undefined // should be 4
*/
tzilist commented 8 years ago

This issue has been fixed, all wrapped functions should now properly return the correct values.