tor-browser

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

S11.6.1_A3.2_T1.2.js (1516B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
      7    operator x + y returns the result of concatenating ToString(x) followed
      8    by ToString(y)
      9 es5id: 11.6.1_A3.2_T1.2
     10 description: >
     11    Type(Primitive(x)) and Type(Primitive(y)) vary between Object
     12    object and Function object
     13 ---*/
     14 
     15 //CHECK#1
     16 if (({} + function(){return 1}) !== ({}.toString() + function(){return 1}.toString())) {
     17  throw new Test262Error('#1: ({} + function(){return 1}) === ({}.toString() + function(){return 1}.toString()). Actual: ' + (({} + function(){return 1})));
     18 }
     19 
     20 //CHECK#2
     21 if ((function(){return 1} + {}) !== (function(){return 1}.toString() + {}.toString())) {
     22  throw new Test262Error('#2: (function(){return 1} + {}) === (function(){return 1}.toString() + {}.toString()). Actual: ' + ((function(){return 1} + {})));
     23 }
     24 
     25 //CHECK#3
     26 if ((function(){return 1} + function(){return 1}) !== (function(){return 1}.toString() + function(){return 1}.toString())) {
     27  throw new Test262Error('#3: (function(){return 1} + function(){return 1}) === (function(){return 1}.toString() + function(){return 1}.toString()). Actual: ' + ((function(){return 1} + function(){return 1})));
     28 }
     29 
     30 //CHECK#4
     31 if (({} + {}) !== ({}.toString() + {}.toString())) {
     32  throw new Test262Error('#4: ({} + {}) === ({}.toString() + {}.toString()). Actual: ' + (({} + {})));
     33 }
     34 
     35 reportCompare(0, 0);