Hi Folks, We've long had two ways to specify SpiderMonkey rooting types in C++: via the canonical definition (e.g., JS::Handle<JSObject*>) and the a set of shortcut typedefs defined in TypeDecls.h (e.g., JS::HandleObject).
Thus far we have relied on a loose cultural understanding of when and where to use each variant, but this approach inevitably creates distracting consistency problems, and is thus something we're moving away from. As the C++ style owner, I would like to resolve this specific issue with consistent guidance. I've spoken with a number of engineers, and the conversations lean in favor of eliminating the typedefs, because: * They don't improve understandability or flexibility, and sometimes hinder them. * Consistency around typedef availability and naming for more complex and esoteric types is an ongoing headache. * Needing a separate header to access the typedefs is occasionally cumbersome. * We don't shortcut other commonly-used handles like RefPtr and already_AddRefed. I do think the typedefs improve readability to some degree, but that those benefits are outweighed by the simplicity and consistency advantages of eliminating them. Please let me know if there are important considerations that appear to have been overlooked. Absent further discussion I plan to update the style guide next week, and we can proceed with eliminating the typedefs from the code as time permits. Thanks, Bobby -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CADa3RMOYt71gnh%3DdHPowY7PqjeFXn7DYo6t7COD3DYEkuRODWg%40mail.gmail.com.
