In the circumstance that an assignment statement must begin with a left parenthesis, it is a good idea for the programmer to provide an explicit semicolon at the end of the preceding statement rather than to rely on automatic semicolon insertion.
This makes sense but how is (d + e).print() an "assignment statement"? Isn't it a CallExpression?
Yea I was wondering if it meant expression statement or even assignment expression since that would cover the d + e bit in the parens. Thank you for clearing that up @lightmare.
AssignmentExpression would also cover the whole of (d + e).print(). That is, it's a CallExpression as you point out, but it's about 18 other things as well. (There are a lot of unit productions in ECMAScript's expression grammar.)
@jmdyck yes, that was just me trying to tie the "assignment statement must begin with a left parenthesis" part of the advice back to that example as I didn't know it was a typo. I wondered if maybe it was referring to the d + e portion because it begins with a (, but it still didn't make sense to call it an assignment statement, so I thought it best to ask here.
Replacing "assignment statement" with "expression statement" clears it up and fits in with what I thought the example was trying to convey.
If it helps, 1. it's non-normative (so precision isn't required) and 2. "assignment statement" is being used as a shorthand for "expression statement whose expression is an assignment expression". So while not fully technically accurate (there's no AssignmentStatement syntactic production), I wouldn't consider it ambiguous, either.