Why does this here refer to windows

  node.js, question
co(function *() {
 var now = Date.now();
 yield sleep200;
 console.log(Date.now() - now);
 });
 
 function co(fn){
 var gen = fn();
 next();
 function next(res){
 var ret;
 ret = gen.next(res);
 //All over
 if(ret.done){
 return;
 bracket
 //Execute callback
 if (typeof ret.value == 'function') {
 ret.value(function(){
 next.apply(this, arguments);
 });
 return;
 bracket
 throw 'yield target no supported!'  ;
 bracket
 bracket
 
 function sleep200(cb){
 setTimeout(cb, 200)
 bracket

On the line next.apply ().
I’m a little confused here, shouldn’t this point call point to the caller? Which is the next object, but here next is a function. But why the window object

ret.value(function(){
 next.apply(this, arguments);
 });
 The argument of ret.value here is a Anonymous function. Have you ever seen this in Anonymous function is not window?