JavaScript:SpiderMonkey:Coding Style: Difference between revisions

Jump to navigation Jump to search
→‎Control Flow: Add the jorendorff rule
No edit summary
(→‎Control Flow: Add the jorendorff rule)
Line 187: Line 187:
  DoThat();
  DoThat();
  DoTheOther();
  DoTheOther();
* Avoid using && or || to mix deciding-whether-to-do-something with error-checking.
if (obj->hasProblems() && !obj->rectify())    /* bad */
    return false;
if (obj->hasProblems()) {                      /* OK */
    if (!obj->rectify())
        return false;
}


= Comments =
= Comments =
638

edits

Navigation menu