tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

11.8.3-3.js (658B)


      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-3
      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    valueOf
     10 ---*/
     11 
     12 var accessed = false;
     13 var obj1 = {
     14  toString: function () {
     15    accessed = true;
     16    return 4;
     17  }
     18 };
     19 var obj2 = {
     20  valueOf: 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);