title: Why does coffeescript generate classes like this?
body: <p>Given the following coffeescript code:</p>
  
  <pre><code>class Animal
    constructor: (@name) -&gt;
    speak: (things) -&gt; "My name is #{@name} and I like #{things}"
  </code></pre>
  
  <p>This is generated:</p>
  
  <pre><code>var Animal = (function() {
    function Animal(name) {
      this.name = name;
    }
    Animal.prototype.speak = function(things) {
      return "My name is " + this.name + " and I like " + things;
    };
    return Animal;
  })();
  </code></pre>
  
  <p>But why isn't this more idiomatic code generated?</p>
  
  <pre><code>var Animal = function Animal(name) {
    this.name = name;
  };
  Animal.prototype.speak = function(things) {
    return "My name is " + this.name + " and I like " + things;
  };
  </code></pre>
  
  <p>I know that coffeescript wraps a lot of stuff in anonymous functions to control scope leak, but what could leak here? </p>