title: Cannot read property 'prototype' of undefined; CoffeeScript inheritance with Require.js
body: <p>I'm using Require.js and CoffeeScript. I have what I find to be a rather strange error.</p>
  
  <p>I have the following definition:</p>
  
  <pre><code>define -&gt;
      {
          Node: class
  
          ChildNode: class extends @Node
  
          Term: class
  
          ChildTerm: class extends @Term
  
      }
  </code></pre>
  
  <p>This raises the following error:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'prototype' of undefined 
  </code></pre>
  
  <p>However, the following both work fine:</p>
  
  <pre><code>define -&gt;
      {
          Node: class
  
          ChildNode: class extends @Node
  
      }
  
  
  
  define -&gt;
      {
          Node: class
  
          ChildNode: class extends @Node
  
          Term: class
  
          ChildTerm: class extends @Node
  
      }
  </code></pre>
  
  <p>What is wrong with my code such that I can't extend <code>Term</code>? I can't see anything different between it and <code>Node</code>.</p>