S11.13.2_A7.5_T3.js (775B)
1 // Copyright (C) 2015 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Compound Assignment Operator evaluates its operands from left to right. 6 description: > 7 The left-hand side expression is evaluated before the right-hand side. 8 Left-hand side expression is MemberExpression: base[prop]. Evaluating 9 ToPropertyKey(prop) throws an error. 10 Check operator is "x -= y". 11 ---*/ 12 13 function DummyError() { } 14 15 assert.throws(DummyError, function() { 16 var base = {}; 17 var prop = { 18 toString: function() { 19 throw new DummyError(); 20 } 21 }; 22 var expr = function() { 23 throw new Test262Error("right-hand side expression evaluated"); 24 }; 25 26 base[prop] -= expr(); 27 }); 28 29 reportCompare(0, 0);