11.8.2-3.js (639B)
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.2-3 6 description: > 7 11.8.2 Greater-than Operator - Partial left to right order 8 enforced when using Greater-than operator: toString > valueOf 9 ---*/ 10 11 var accessed = false; 12 var obj1 = { 13 toString: function () { 14 accessed = true; 15 return 3; 16 } 17 }; 18 var obj2 = { 19 valueOf: function () { 20 return 4; 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);