Currently the use of [[deprecated]] is disallowed, though:
https://firefox-source-docs.mozilla.org/code-quality/coding-style/using_cxx_in_firefox_code.html#notes
> |[[deprecated]]|: If we have deprecated code, we should be removing
it rather than marking it as such. Marking things as |[[deprecated]]|
also means the compiler will warn if you use the deprecated API, which
turns into a fatal error in our automation builds, which is not helpful.
On 01/06/2022 14:38, Mirko Brodesser wrote:
On Friday, May 27, 2022 at 7:45:18 PM UTC+2 Bobby Holley wrote:
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.
Just for the sake of completeness, one could use C++14's
`[[deprecated]]` keyword [1] here. Mentioning it, because it's
currently rarely used in Gecko [2].
[1] https://en.cppreference.com/w/cpp/language/attributes/deprecated
[2]
https://searchfox.org/mozilla-central/search?q=%5B%5Bdeprecated%5D%5D&path=&case=true®exp=false
Mirko
Thanks,
Bobby
--
You received this message because you are subscribed to a topic in the
Google Groups "dev-platform@mozilla.org" group.
To unsubscribe from this topic, visit
https://groups.google.com/a/mozilla.org/d/topic/dev-platform/7BuPwiBdMo8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
dev-platform+unsubscr...@mozilla.org.
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/5aff66bd-3d42-41b3-9790-70dbf52aa744n%40mozilla.org
<https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/5aff66bd-3d42-41b3-9790-70dbf52aa744n%40mozilla.org?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"dev-platform@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dev-platform+unsubscr...@mozilla.org.
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/93c3a4d9-6ae1-d808-5d2e-819acca36c9b%40mozilla.com.