[JS-internals] Proxy question

2013-06-20 Thread Nicholas Nethercote
Hi, Here's some code from jsproxy.h: inline bool IsObjectProxyClass(const Class *clasp) { return clasp == js::ObjectProxyClass || clasp == js::OuterWindowProxyClass; } inline bool IsFunctionProxyClass(const Class *clasp) { return clasp == js::FunctionProxyClass; } inline bool

Re: [JS-internals] Proxy question

2013-06-20 Thread Bill McCloskey
It looks like ProxyClass is only used for the Proxy object that we add to the global (i.e., the thing that allows you to do Proxy.create). That object isn't actually a proxy at all. It probably would make sense to rename ProxyClass to something less confusing. -Bill - Original Message

Re: [JS-internals] Proxy question

2013-06-20 Thread Luke Wagner
Agreed. Hard to think of a name that isn't ambiguous with ObjectProxyClass/FunctionProxyClass. Perhaps ProxySingletonClass? - Original Message - It looks like ProxyClass is only used for the Proxy object that we add to the global (i.e., the thing that allows you to do Proxy.create).

Re: [JS-internals] What's in a (handle's) name?

2013-06-20 Thread Brendan Eich
+1, FWIW. Templates as implementation detail should be abstracted using typedefs. Even templates as API can use typedef shorthanding -- it's a form of BD programming to make all consumers spell out the long-hand just to be over-concrete, or pay homage to C++. /be Bobby Holley wrote: I like

Re: [JS-internals] Proxy question

2013-06-20 Thread Tom Schuster
ProxyConstructor or java style proxyfactory On Jun 20, 2013 8:12 PM, Luke Wagner l...@mozilla.com wrote: Agreed. Hard to think of a name that isn't ambiguous with ObjectProxyClass/FunctionProxyClass. Perhaps ProxySingletonClass? - Original Message - It looks like ProxyClass is

Re: [JS-internals] What's in a (handle's) name?

2013-06-20 Thread Steve Fink
Then the question becomes whether in this case the templates are an implementation detail or a useful part of the type. bz has code that makes use of the fact that they're templates. It sounds like our marking code does something similar. Both of those imply that it is an aspect of the types

Re: [JS-internals] What's in a (handle's) name?

2013-06-20 Thread Bobby Holley
On Thu, Jun 20, 2013 at 11:27 AM, Steve Fink sf...@mozilla.com wrote: I suppose you could argue that you could use both, typedefs by default and templates only when you need them. But having both means people always have to decide which to use, which feels to me like unnecessary API friction.

Re: [JS-internals] Proxy question

2013-06-20 Thread Brendan Eich
It's not a factory. Cc'ing Dave and Sam, who may have a thought. We've talked in TC39 about putting it in a built-in module. /be Tom Schuster wrote: ProxyConstructor or java style proxyfactory On Jun 20, 2013 8:12 PM, Luke Wagnerl...@mozilla.com wrote: Agreed. Hard to think of a name

Re: [JS-internals] Proxy question

2013-06-20 Thread Nicholas Nethercote
ProxyConstructor That's the one I like best so far. Nick ___ dev-tech-js-engine-internals mailing list dev-tech-js-engine-internals@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Re: [JS-internals] What's in a (handle's) name?

2013-06-20 Thread Nicholas Nethercote
I agree that doing the same thing inside and outside SpiderMonkey is preferable. I slightly favour using typedefs, to minimize keystrokes. For the weird bz case he can use explicit template syntax. Nick ___ dev-tech-js-engine-internals mailing list