11.8.3-4.js (660B)
1 // Copyright (c) 2012 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es5id: 11.8.3-4 6 description: > 7 11.8.3 Less-than-or-equal Operator - Partial left to right order 8 enforced when using Less-than-or-equal operator: toString <= 9 toString 10 ---*/ 11 12 var accessed = false; 13 var obj1 = { 14 toString: function () { 15 accessed = true; 16 return 4; 17 } 18 }; 19 var obj2 = { 20 toString: function () { 21 return 2; 22 } 23 }; 24 25 assert.sameValue(obj1 <= obj2, false, 'The result of (obj1 <= obj2) is false'); 26 assert.sameValue(accessed, true, 'The value of accessed is true'); 27 28 reportCompare(0, 0);