Created
December 2, 2016 02:38
-
-
Save jooyunghan/cca5994cd63a6fa9379d0b5addfcc3df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Context() { | |
this.next = 0; | |
} | |
var stop = {}; | |
Context.prototype.stop = function stop() { | |
return stop; | |
} | |
function GenFun(c, genf) { | |
this.c = c; | |
this.genf = genf; | |
} | |
GenFun.prototype[Symbol.iterator] = function iterator() { | |
return new GenIter(this.c, this.genf); | |
} | |
function wrap(genf) { | |
var c = new Context(); | |
return new GenFun(c, genf); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment