Determine if a value is Callable/Constructible

Axel Rauschmayer axel at rauschma.de
Mon Mar 30 06:47:23 UTC 2015


> There is no intrinsic reason why we needed to mandate that class constructors should throw when called.  We even provided a simple and straight forward way (new.target===undefined) that a ES constructor body can use to determine whether it was called or new’ed.
> 
> I think we should just drop that throws when called feature of class constructors.. 
> 
> (The restriction was added to future proof for the possibility of inventing some other way to provide a class with distinct new/call behavior. I don’t think we need nor can afford to wait for the invention of a new mechanism which will inevitably be more complex than new.target, which we already have.)
> 
> I don't think this is an accurate representation of the discussion we had.

Any other reasons for throwing? It’d be great to know what they were!

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150330/c4da6c48/attachment.html>


More information about the es-discuss mailing list