On 2016/09/02 16:02, Nicholas Nethercote wrote:
Greetings,
NS_WARN_IF_FALSE has been renamed NS_WARNING_ASSERTION.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1299727 for details,
including the justification.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1300007 for a bug
that this change exposed, thus adding weight to the justification.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1300002 for a
comm-central patch.
Nick
I think it is a good time to ask about a confusing issue.
In the following URL about coding style,
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style
there is a section about NS_WARN_IF.
I quote it below.
--- begin quote ---
Use the NS_WARN_IF macro when errors are unexpected.
The NS_WARN_IF macro can be used to issue a console warning in debug
builds if the condition fails. This should only be used when the failure
is unexpected and cannot be caused by normal web content.
If you are writing code that wants to issue warnings when methods fail,
please either use NS_WARNING directly or use the new NS_WARN_IF macro.
if (NS_WARN_IF(somethingthatshouldbetrue)) {
return NS_ERROR_INVALID_ARG;
}
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
--- end quote ----
I am not a native speaker of English, but shouldn't the variable name in
the first if-statement example be
|somethingthatshouldNOTbetrue| instead of |somethingthatshouldbetrue|?
If so, Japanese, Chinese and Russian translation ought to be changed as
well.
I may have found a few code fragments that may have been miswritten due
to misunderstanding.
TIA
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform