w3ctag / subclassable-apis-guide

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

Discuss internal state installation and brand checks #2

Open domenic opened 10 years ago

domenic commented 10 years ago

In ES6 this is done via @@create installing a list of [[InternalSlots]].

Discuss how brand checks should be kept to the minimum possible, e.g. promises only require the brand once (Promise.prototype.then) and use the brand to make a decision one other time (Promise.resolve).

This will require specs making their internal slots more explicit so they can be installed on arbitrary objects.

annevk commented 10 years ago

Yeah, putting these in IDL would make some sense in my opinion.