Re: Add Reflect.isConstructor and Reflect.isCallable?

2015-02-26 Thread Tom Schuster
Was this discussed? I can't find any reference to it. On Mon, Dec 22, 2014 at 1:34 AM, Gary Guo nbdd0...@hotmail.com wrote: If added, it can help ES engines to write more code in ES instead of native languages. So +1 as well. ___ es-discuss

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-21 Thread Tom Van Cutsem
Adding Reflect.{isCallable, isConstructor} looks reasonable to me. If the spec needs these internally, chances are JS developers will need them at one point. And as you note, typeof === function is a common work-around in use today. So +1. 2014-12-21 0:20 GMT+01:00 Tom Schuster t...@schuster.me:

RE: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-21 Thread Gary Guo
If added, it can help ES engines to write more code in ES instead of native languages. So +1 as well. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-20 Thread Tom Schuster
Thank you both. Looking forward to the feedback. On Fri, Dec 19, 2014 at 6:55 PM, Rick Waldron waldron.r...@gmail.com wrote: Done: https://github.com/tc39/agendas/blob/master/2015/01.md On Fri Dec 19 2014 at 12:26:33 PM Jason Orendorff jason.orendo...@gmail.com wrote: Having said that, I

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-19 Thread Tom Schuster
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)

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-19 Thread Jason Orendorff
On Tue, Dec 16, 2014 at 3:05 PM, Tom Schuster t...@schuster.me wrote: Hello, right now there is no way in normal JS code to replicate the IsConstructor check defined in 7.2.4. function isConstructor(obj) { var p = new Proxy(obj, {construct() { return p; }}); try { new p; }

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-19 Thread Jason Orendorff
Having said that, I do think Reflect.isCallable and isConstructor would be a fine addition to ES7. These places where we check if an internal method exists feel like a sort of secret-handshake part of the MOP; we should expose them. Any objections? Would someone please add it to the agenda for

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-19 Thread Rick Waldron
Done: https://github.com/tc39/agendas/blob/master/2015/01.md On Fri Dec 19 2014 at 12:26:33 PM Jason Orendorff jason.orendo...@gmail.com wrote: Having said that, I do think Reflect.isCallable and isConstructor would be a fine addition to ES7. These places where we check if an internal method

Add Reflect.isConstructor and Reflect.isCallable?

2014-12-16 Thread Tom Schuster
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 ___ es-discuss