title: Confusing Uncaught Reference Error for global JS variable
body: <p>Before I'm attempting to namespace my code, and have 2 coffeescript files in a rails project that generate this:</p>
  
  <pre><code>(function(){
    window.Investments = {};
  }).call(this);
  </code></pre>
  
  <p>Then My backbone collection:</p>
  
  <pre><code>(function(){
    Investments.InfrastructureCollection = Backbone.Collection.extend({});
  }).call(this);
  </code></pre>
  
  <p>The console in chrome throws a <code>Uncaught ReferenceError: Investments is not defined</code> where I set up my InfrastructureCollection on page load, but everything seems to execute fine and things load up as they should. I can even create new instances of the collection and add models in the console without having to set anything up. What's going on here in the console to throw the error?</p>