11.8.3-1.js (652B)
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-1 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: valueOf <= valueOf 9 ---*/ 10 11 var accessed = false; 12 var obj1 = { 13 valueOf: function () { 14 accessed = true; 15 return 4; 16 } 17 }; 18 var obj2 = { 19 valueOf: function () { 20 return 2; 21 } 22 }; 23 24 assert.sameValue(obj1 <= obj2, false, 'The result of (obj1 <= obj2) is false'); 25 assert.sameValue(accessed, true, 'The value of accessed is true'); 26 27 reportCompare(0, 0);