old_contents: function getFoo () {
    return new Promise(function (resolve, reject){
      resolve('foo');
    });
  }
  
  function run (generator) {
    var it = generator();
  
    function go(result) {
      if (result.done) return result.value;
      
      return result.value.then(function (value) {
        return go(it.next(value));
      }, function (error) {
        return go(it.throw(value));
      });
      
    }
  
    go(it.next());
  }
  
  run(function* () {
    try {
      var foo = yield getFoo();
      console.log(foo);
    } catch (e) {
      console.log(e);
    }
  });
  
new_contents: function getFoo () {
    return new Promise(function (resolve, reject){
      resolve('foo');
    });
  }
  
  function run (generator) {
    var it = generator();
  
    function go(result) {
      if (result.done) return result.value;
      
      return result.value.then(function (value) {
        return go(it.next(value));
      }, function (error) {
        return go(it.throw(error));
      });
      
    }
  
    go(it.next());
  }
  
  run(function* () {
    try {
      var foo = yield getFoo();
      console.log(foo);
    } catch (e) {
      console.log(e);
    }
  });
  
subject: fix arguments in promise reject