Re: custom proto arg for Proxy.createFunction?

2011-02-25 Thread Lasse Reichstein
On Wed, 23 Feb 2011 23:41:00 +0100, David Bruant bru...@enseirb-matmeca.fr wrote: Le 23/02/2011 23:26, David Herman a écrit : I've been working on a prototype implementation of the binary data spec in pure JS (implemented via typed arrays) and I've been bitten by the lack of a standard

Re: custom proto arg for Proxy.createFunction?

2011-02-25 Thread Brendan Eich
On Feb 25, 2011, at 5:41 AM, Lasse Reichstein wrote: As long as __proto__ is writable, that can be changed later anyway. If we get rid of writable __proto__, then it would be an invariant. We will work to get rid of writable __proto__ and then __proto__ altogether, but that will take time and

Re: custom proto arg for Proxy.createFunction?

2011-02-25 Thread Boris Zbarsky
On 2/25/11 9:05 AM, Brendan Eich wrote: typeof x == typeof y x == y= x === y (That one, I believe all engines uphold.) Though Spidermonkey used to not have this for x and y objects (equality hooks, etc). Has that changed? -Boris ___

Re: custom proto arg for Proxy.createFunction?

2011-02-25 Thread Brendan Eich
On Feb 25, 2011, at 9:00 AM, Boris Zbarsky wrote: On 2/25/11 9:05 AM, Brendan Eich wrote: typeof x == typeof y x == y= x === y (That one, I believe all engines uphold.) Though Spidermonkey used to not have this for x and y objects (equality hooks, etc). Has that changed? Those

Re: custom proto arg for Proxy.createFunction?

2011-02-24 Thread David Bruant
Ok... hmm... well... I misread your initial post. You wanted to enforce the condition on the argument proto object, not the object returned by Proxy.createFunction. My apologies, here's my fixed response: Le 24/02/2011 11:42, David Bruant a écrit : Le 24/02/2011 02:32, David Herman a écrit :

custom proto arg for Proxy.createFunction?

2011-02-23 Thread David Herman
I've been working on a prototype implementation of the binary data spec in pure JS (implemented via typed arrays) and I've been bitten by the lack of a standard mechanism for subclassing Function. I'm using proxies for the implementation, and Proxy.createFunction doesn't let me specify a

Re: custom proto arg for Proxy.createFunction?

2011-02-23 Thread David Herman
PS Correction: it's actually a non-standard extension that regexps are callable in SpiderMonkey. So the invariant is that the only callable non-host objects are descendants of Function, or possibly host objects. This doesn't change my overall point, though. On Feb 23, 2011, at 2:26 PM, David

Re: custom proto arg for Proxy.createFunction?

2011-02-23 Thread David Bruant
Le 23/02/2011 23:26, David Herman a écrit : I've been working on a prototype implementation of the binary data spec in pure JS (implemented via typed arrays) and I've been bitten by the lack of a standard mechanism for subclassing Function. I'm using proxies for the implementation, and

Re: custom proto arg for Proxy.createFunction?

2011-02-23 Thread David Herman
With your optional argument, I see a second solution that could be consistent. The prototype chain could contain the provided prototype then Function.prototype (obj -- proto -- Function.prototype -- null as opposed to your proposition which is: obj -- proto -- null ). Hence, there would be

Re: custom proto arg for Proxy.createFunction?

2011-02-23 Thread Brendan Eich
On Feb 23, 2011, at 2:26 PM, David Herman wrote: Maciej has also suggested a Function.create(...) API for more lightweight creation of function subtypes. Maciej proposal, first raised here: https://mail.mozilla.org/pipermail/es-discuss/2009-March/008954.html and recorded as part of a

Re: custom proto arg for Proxy.createFunction?

2011-02-23 Thread David Bruant
Le 23/02/2011 23:54, David Herman a écrit : With your optional argument, I see a second solution that could be consistent. The prototype chain could contain the provided prototype then Function.prototype (obj -- proto -- Function.prototype -- null as opposed to your proposition which is: obj