jasnell / proposal-istypes

TC-39 Proposal for additional is{Type} APIs
201 stars 7 forks source link

How does this handle subclasses? #8

Closed rwaldron closed 7 years ago

rwaldron commented 8 years ago
class List extends Array {}
// List inherited isArray
List.isArray(new List()) === true;

Without any additional language, this will be the case for all of the methods defined in this proposal. I'm just looking for an acknowledgement that this is the intention or not—I presently have no opinion whether or not that's the right thing across the board, that will take time to consider.

jasnell commented 8 years ago

The short answer, yes. The longer answer is: this is largely unintentional in that this was not specifically a design goal but it's recognized that this would be the case... (hopefully that makes sense).

rwaldron commented 8 years ago

(hopefully that makes sense).

It does!