Add Reflect.isConstructor and Reflect.isCallable?

Tom Schuster tom at schuster.me
Fri Dec 19 03:55:24 PST 2014


Is there somebody interested in this? The draft spec is rather simple:

Reflect.isCallable (target)

1. If Type(target) is not Object, then throw a TypeError exception.
2. Return the result of calling the abstract operation IsCallable(target).

 Reflect.isConstructor (target)

1. If Type(target) is not Object, then throw a TypeError exception.
2. Return the result of calling the abstract operation
IsConstructor(target).

I am not sure about step 1, but it follows the style of Reflect.isExtensible

On Tue, Dec 16, 2014 at 10:05 PM, Tom Schuster <tom at schuster.me> wrote:
>
> Hello,
>
> right now there is no way in normal JS code to replicate the IsConstructor
> check defined in 7.2.4.
> IsCallable can be done with "typeof == function". I think this might be
> useful in some cases and is trivial to implement.
>
> Cheers,
> Tom
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141219/f721d77f/attachment.html>


More information about the es-discuss mailing list