Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: got rid of switch and converted the list of contexts to look more like the TS 17961 list; reviewed

Do not use the assignment operator in the following cases contexts because it typically indicates programmer error and can result in unexpected behavior:

  • Controlling expression of if, switch (selection statement (controlling expression)
  • while (controlling expression)
  • Controlling expression of while, do ... while (iteration statementcontrolling expression) 
  • Second operand of for  (iteration statementsecond operand) 
  • First operand of ?: (selection statementfirst operand)
  • && (either operand)
  • Either operand of || or && (logical operators)  (either operand)
  • comma operator (second operand) Second operand of comma operator when the comma expression is used in any of these contexts
  • Second and third operands of ?: (selection statementsecond or third operands) where the ternary expression is used in any of these contexts

...