2.1.8 [ECMA-262/7] Section 12.4.6.1 Runtime Semantics: Evaluation

V0191: The reference is retrieved twice

The specification states:

 12.4.6.1 Runtime Semantics: Evaluation
  
     UpdateExpression : ++ UnaryExpression
  
         1.  Let expr be the result of evaluating UnaryExpression.
         2.  Let oldValue be ? ToNumber(? GetValue(expr)).
         3.  Let newValue be the result of adding the value 1 to oldValue, using the same 
             rules as for the + operator (see 12.8.5).
         4.  Perform ? PutValue(expr, newValue).
         5.  Return newValue.

EdgeHTML Mode

Between steps 2 and 3 the following steps are added:

    a. If Type(expr) is a Reference and if IsUnresolvableReference(_expr_) is false:

       1.  Assert: expr is a reference to an Environment Record.

       2.  Let hs be the result of evaluating an Identifier _id_ whose StringValue is GetReferencedName(expr) as if _id_ were a LeftHandSideExpression.

       3.  ReturnIfAbrupt(expr);

As a result, the reference is retrieved twice.