use coffeescript's __extends in javascript