tor-browser

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

S15.5.2.1_A3.js (949B)


      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: The [[Class]] property of the newly constructed object is set to "String"
      6 es5id: 15.5.2.1_A3
      7 description: >
      8    Creating string object with "new String(string)" and changing
      9    toString property to Object.prototype.toString
     10 ---*/
     11 
     12 var __str__obj = new String("seamaid");
     13 
     14 __str__obj.toString = Object.prototype.toString;
     15 
     16 //////////////////////////////////////////////////////////////////////////////
     17 //CHECK#1
     18 if (__str__obj.toString() !== "[object " + "String" + "]") {
     19  throw new Test262Error('#1: var __str__obj = new String("seamaid"); __str__obj.toString = Object.prototype.toString; __str__obj.toString() === "[object String]". Actual: __str__obj.toString() ===' + __str__obj.toString());
     20 }
     21 //
     22 //////////////////////////////////////////////////////////////////////////////
     23 
     24 reportCompare(0, 0);