w3ctag / subclassable-apis-guide

How and why to design APIs that allow subclassing
3 stars 8 forks source link

Discuss method delegation #1

Open domenic opened 10 years ago

domenic commented 10 years ago

E.g. Promise.prototype.catch delegates directly to this.then, or Array.prototype.map delegates directly to this.constructor, which allows subclasses to inherit behavior that "does the right thing."