Are function calls with arguments valid left-Hand-Side-Expressions according to ECMAScript ?
LeftHandSideExpression[Yield, Await] :
NewExpression[?Yield, ?Await]
CallExpression[?Yield, ?Await]
OptionalExpression[?Yield, ?Await]
if we go further deep into CallExpression we can see below the non-terminal CallExpression something like this:
CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
does that mean writing something like:
alert('Hello') = 1;
is valid. And if you run the above code you will see that the function call takes place before the ReferenceError: Invalid left-hand side in assignment is given