-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function.isCallable() / Function.isConstructor() example matrix #10
Comments
It will take some work to put together a complete matrix, I don't know when I'll have the time to complete this. But my vision overall is: Refers to isCallable() specifically:
Similar logic would apply to isConstructor. If I get some time, and someone is interested in championing this in tc39, I'm happy to draft a matrix to help out |
The reason why I'm asking about this, is to determine whether the implementation by Core-JS actually satisfies your vision, or if it is lacking. I'm particularly concerned with the about the "isClassConstructor" part in Core-JS (not intended as criticism of the author). I guess what I'm trying to ask for, is if this proposal can be polyfilled. If so, perhaps that could be a place to start and continue to ask tc39 champions for help (sorry, I'm not much help here because I'm not skilled enough). In any case, I do hope that this proposal gets through. JavaScript developers could really benefit from this type of "simple" functionality. |
I believe this would have false negatives, in the case where a class constructor is bound. OTOH, a bound class constructor should fail the toString test, and the property descriptor test I may be wrong about that, ill take a look not on mobile in a bit to be sure. Probably does not have false positives, though |
Yeah,
|
Yep, AFAIK we have no way to detect bound classes. So it's marked |
yeah, it's not fully polyfillable, but it gets pretty close. |
BTW I'm planning to remove proposals that have not progressed for a long time from |
It needs a champion to really get it anywhere, I can talk to my colleagues about raising it in committee, but it's not a super high priority atm |
Thanks for your input. I really hope that this proposal will get through. |
Hi
Would it be possible to provide an example matrix with various argument types and the expected result of
isCallable()
andisConstructor()
?Currently, I'm looking at Core-JS' implementation of this proposal and I'm wondering how built-in classes, e.g.
Array
,Proxy
...etc, are expected to behave when tested via these methods.The text was updated successfully, but these errors were encountered: