> Oh, wait, not quite. What's the policy on Rooted and Handle types within
> .cpp files, for one-offs or rarely-used types? We have a number of
> these, mostly for Rooted, and it seems weird to use a local typedef when
> you're probably only using it to avoid losing type information in the
> first place (eg using a Handle<JSLinearString*> instead of a
> HandleString because the callee wants to know it's dealing with a
> JSLinearString.) Is it mandatory to use a typedef to match the standard
> style? Encouraged? Discouraged? I guess it's ok to leave it to the coder
> and reviewer, but we already know that this is an area with widely
> divergent opinions on aesthetic gut-feel...

typedef'ing every single one seems like overkill but if there are more than 2 
or 3 uses of a given Handle/Rooted template-id, then I think it does make sense 
to add a typedef for consistency.  E.g., I can see that there is already a 
local HandlePropertyName in the frontend for this reason.  Throwing away type 
information (HandleLinearString -> HandleString) shouldn't be necessary and the 
regularity of the HandleX naming scheme shouldn't increase anyone's cognitive 
burden.

> The set of programmers who already
> understand Handles is pretty close to the empty set, or at least it
> oscillates between the empty set and something very small.

It should include most SM and JS-touching Gecko hackers by now.  Unless you 
using some deep-grokking definition of 'understand', but I don't think that 
definition makes sense to use in this context.
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to