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