2.1.33 [ECMA-262-1999] Section 11.8.3, The Less-than-or-equal Operator ( <= )


The production RelationalExpression : RelationalExpression <= ShiftExpression is evaluated as follows:

  1. Evaluate RelationalExpression.

  2. Call GetValue(Result(1)).

  3. Evaluate ShiftExpression.

  4. Call GetValue(Result(3)).

  5. Perform the comparison Result(4) < Result(2) __with the LeftFirst flag set to false.__ (see [ECMA-262-1999] section 11.8.5).

  6. If Result(5) is true or undefined, return false. Otherwise, return true.

ECMAScript generally uses a left-to-right evaluation order; however, the ES3 specification of the <= operator results in an observable partial right-to-left evaluation order when the application of ToPrimitive on both operands has visible side effects. JScript 5.x implements strict left-to-right evaluation order for the operands of <=. Any ToPrimitive side effects caused by evaluating the left operand are visible before ToPrimitive is applied to the right operand.