Determining if an object can be constructed

Oriol _ oriol-bugzilla at
Tue Jan 17 22:56:26 UTC 2017

See my

I also thought the `extends` trick could be useful, but it fails 3 of my tests. It doesn't work for bounded normal functions and some proxy objects.

The proper way is the second one in Claude's post: using a proxy object.

There is only a problem: it doesn't work for revoked proxies, because they can't be used as a proxy target.

In my opinion that restriction is somewhat stupid, because you can use a revocable proxy as a proxy target, and revoke it later.

But I guess it's too late to change that. Maybe some day we will have `Object.isConstructor`.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list