title: Why is node.js generator not working as expected?
body: <p>Given the following two code snippets, why is the transaction object visible in the working case but not visible in the other case?</p>
  
  <p>Working case:</p>
  
  <pre><code>return db.transaction(function(transaction) {
    return co(function*() {
      // transaction is visible, do something with it -&gt; works
    }
  }
  </code></pre>
  
  <p>Not working case:</p>
  
  <pre><code>var c = co(function*() {
     // transaction is NOT visible -&gt; does not work!
  });
  
  return db.transaction(function(transaction) {
    return c;
  });
  </code></pre>
  
  <p>Is it possible to make transaction visible in the second case?</p>