Determine if a value is Callable/Constructible

Caitlin Potter caitpotter88 at
Mon Mar 30 18:03:32 UTC 2015

I think we’re on the same page that the runtime is the one doing the throwing, but that doesn’t really matter. The point is, if you can’t actually invoke the authored code, you can’t really call the authored code “call-able”. To the VM, the difference doesn’t matter a whole lot, but to human beings, it does. It’s disingenuous to call it “call-able” if the authored code can’t be “called”. (A proxy trap doesn’t really make it “callable” either, it just allows different code to be “called” in its place).

It could still be identified as a “function” for compat with ES5, but the behaviour is different from any other sort of function, it should be identifiable as different.

> On Mar 30, 2015, at 1:54 PM, Domenic Denicola <d at> wrote:
> The distinction you're really pointing to here is the distinction between user-generated throwing functions and runtime-generated ones. Both are called. User-generated ones you could edit the source code of and insert a `called = true` line first, whereas runtime-generated ones you could not. But that's not a real material difference in call-ability.

More information about the es-discuss mailing list