On 2016/09/22 5:56, Daniel Holbert wrote:
On 09/21/2016 12:48 PM, ISHIKAWA,chiaki wrote:
In the following URL about coding style,
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style
--- begin quote ---
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|?

You're very right!  I've fixed it to say "somethingthatshouldbefalse"
(s/true/false/):
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style$compare?locale=en-US&to=1122081&from=1086401


Thank you for fixing the issue so quickly.

If so, Japanese, Chinese and Russian translation ought to be changed as
well.

I am not qualified to fix those. I'm hoping you & others can take care
of that, perhaps! :)

I am not sure how to alert the translation contributors. Does anyone know how?

I may have found a few code fragments that may have been miswritten due
to misunderstanding.

Yikes! Please file bugs on those. Hopefully they are just cases of of us
accidentally warning in the wrong condition, rather than us actually
behaving incorrectly.

The particular issue I was struggling with turned out to be NOT the warning in the wrong condition, but the failure to use the return value of NS_WARN_IF, and I am not sure if I got it right now that I re-read the developer page :-( Bug 1304504 - Check the return value of GetIntPref() properly or an initialized bogus value may be used
https://bugzilla.mozilla.org/show_bug.cgi?id=1304504

I was confused to no end when I read the original coding guideline page.
Thank you again for the quick fix. I hope future developers won't be confused any longer :-)



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

Reply via email to