Re: proposal to use JS GC Handle/Rooted typedefs everywhere

2013-10-30 Thread Boris Zbarsky

On 10/29/13 4:42 PM, Boris Zbarsky wrote:

In that case, we might as well switch to typedefs.  JS engine hackers
are landing them in non-JS code anyway, because they're so used to it in
their own code (c.f. bug 884410 and bug 930782 at the very least, making
changes to DOM code to add typedef uses with no review from DOM peers).


To be clear, a change like this _shouldn't_ need review from DOM peers. 
 The fact that in today's world it technically does so we can tell 
people to not use the typedefs is totally silly.


-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: proposal to use JS GC Handle/Rooted typedefs everywhere

2013-09-19 Thread Nicholas Nethercote
On Wed, Sep 18, 2013 at 12:55 PM, Luke Wagner l...@mozilla.com wrote:
   So, can we agree to use the typedefs all over Gecko?

And note that js/public/TypeDecls.h (included with |#include
js/TypeDecls.h) has the most common of these typedefs in one
convenient location.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


proposal to use JS GC Handle/Rooted typedefs everywhere

2013-09-18 Thread Luke Wagner
To save typing, the JS engine has typedefs like
  typedef HandleJSObject* HandleObject;
  typedef RootedJS::Value RootedValue;
and the official style is to prefer the HandleX/RootedX typedefs when there is 
no need to use the HandleX/RootedX template-ids directly.

This issue was discussed off and on in the JS engine for months, leading to a 
m.d.t.js-engine.internals newsgroup thread 
(https://groups.google.com/forum/#!topic/mozilla.dev.tech.js-engine.internals/meWx5yxofYw)
 where it was discussed more (the high occurrence of Handle/Rooted in the JS 
engine combined with the relatively insignificant difference between the two 
syntactic forms making a perfect bike shed storm).

Given that the JS engine has the official style of use the typedefs, it seems 
like a shame for Gecko to use a different style; while the difference may be 
insignificant, we do strive for consistency.  So, can we agree to use the 
typedefs all over Gecko?  From the m.d.t.js-engine.internals thread I think 
bholley of the kingdom of XPConnect is strongly in favor.

(Again, this doesn't have to be an absolute rule, the needs of meta-programming 
and code-generators can override.)

Cheers,
Luke
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: proposal to use JS GC Handle/Rooted typedefs everywhere

2013-09-18 Thread smaug

On 09/18/2013 10:55 PM, Luke Wagner wrote:

To save typing, the JS engine has typedefs like typedef HandleJSObject* 
HandleObject; typedef RootedJS::Value RootedValue; and the official
style is to prefer the HandleX/RootedX typedefs when there is no need to use the 
HandleX/RootedX template-ids directly.

This issue was discussed off and on in the JS engine for months, leading to a 
m.d.t.js-engine.internals newsgroup thread
(https://groups.google.com/forum/#!topic/mozilla.dev.tech.js-engine.internals/meWx5yxofYw)
 where it was discussed more (the high occurrence of
Handle/Rooted in the JS engine combined with the relatively insignificant 
difference between the two syntactic forms making a perfect bike shed
storm).

Given that the JS engine has the official style of use the typedefs, it seems 
like a shame for Gecko to use a different style; while the
difference may be insignificant, we do strive for consistency.  So, can we 
agree to use the typedefs all over Gecko?  From the
m.d.t.js-engine.internals thread I think bholley of the kingdom of XPConnect is 
strongly in favor.


I don't care too much whether we use Handle/RootedFoo or typedefs but 
consistency is always good.
(And except in WebIDL bindings and in XPConnect we should try to use JSAPI 
manually a little as possible.
Bindings should hide JSAPI usage.)


-Olli



(Again, this doesn't have to be an absolute rule, the needs of meta-programming 
and code-generators can override.)

Cheers, Luke



___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: proposal to use JS GC Handle/Rooted typedefs everywhere

2013-09-18 Thread Bobby Holley
On Wed, Sep 18, 2013 at 12:55 PM, Luke Wagner l...@mozilla.com wrote:
 Given that the JS engine has the official style of use the typedefs, it 
 seems like a shame for Gecko to use a different style; while the difference 
 may
 be insignificant, we do strive for consistency.  So, can we agree to use the 
 typedefs all over Gecko?  From the m.d.t.js-engine.internals thread I think
 bholley of the kingdom of XPConnect is strongly in favor.

Indeed. Make it so.

bholley
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform