exp-assignment-operator.js (947B)
1 // Copyright (C) 2016 Rick Waldron. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 author: Rick Waldron 6 esid: sec-assignment-operators-runtime-semantics-evaluation 7 description: Compound Exponentiation Assignment Operator 8 info: | 9 AssignmentExpression: 10 LeftHandSideExpression AssignmentOperator AssignmentExpression 11 12 1. Let lref be the result of evaluating LeftHandSideExpression. 13 2. Let lval be ? GetValue(lref). 14 3. Let rref be the result of evaluating AssignmentExpression. 15 4. Let rval be ? GetValue(rref). 16 5. Let op be the @ where AssignmentOperator is @=. 17 6. Let r be the result of applying op to lval and rval as if evaluating the expression lval op rval. 18 7. Perform ? PutValue(lref, r). 19 8. Return r. 20 features: [exponentiation] 21 ---*/ 22 23 var base = -3; 24 25 assert.sameValue(base **= 3, -27, "(base **= 3) === -27; where base is -3"); 26 27 reportCompare(0, 0);