function point(x,y){ this.x=x; this.y=y; this.draw=function(){....} } function line(p1,p2){ this.p1=p1; this.p2=p2; this.superclass=point; }