Determine if a value is Callable/Constructible

Yehuda Katz wycats at gmail.com
Mon Mar 30 15:40:47 UTC 2015


Yehuda Katz
(ph) 718.877.1325

On Mon, Mar 30, 2015 at 8:09 AM, Domenic Denicola <d at domenic.me> wrote:

> I don’t think [Symbol.call] is a very good mechanism. A new syntactic form
> would make more sense.
>
> It doesn’t seem right that you should have to introduce an observable
> prototype property just to get [[Call]] behavior. (Or a constructor
> property, if you change the syntax to `static [Symbol.call]() { … }`.)
>

A new syntactic form sounds good to me :)


>
> And it raises the question of what happens when I add a [Symbol.call]
> property to other objects. What does it even mean? If I do `var obj = {
> prototype: { [Symbol.call]() { console.log("foo"); } } }`, can I now call
> `obj()`? Is `typeof obj === "function"`? Very strange stuff. Presumably not
> very VM-friendly either, but that's just a guess.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150330/09fc7a52/attachment.html>


More information about the es-discuss mailing list