tor-browser

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

S15.2.1.1_A1_T5.js (1239B)


      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    When the Object(value) is called and the value is null, undefined or not supplied,
      7    create and return a new Object object if the object constructor had been called with the same arguments (15.2.2.1)
      8 es5id: 15.2.1.1_A1_T5
      9 description: Creating Object(x) and checking its properties
     10 ---*/
     11 
     12 var __obj = Object(x);
     13 
     14 var n__obj = new Object(x);
     15 
     16 assert.sameValue(
     17  __obj.toString(),
     18  n__obj.toString(),
     19  '__obj.toString() must return the same value returned by n__obj.toString()'
     20 );
     21 
     22 assert.sameValue(
     23  __obj.constructor,
     24  n__obj.constructor,
     25  'The value of __obj.constructor is expected to equal the value of n__obj.constructor'
     26 );
     27 
     28 assert.sameValue(
     29  __obj.prototype,
     30  n__obj.prototype,
     31  'The value of __obj.prototype is expected to equal the value of n__obj.prototype'
     32 );
     33 
     34 assert.sameValue(
     35  __obj.toLocaleString(),
     36  n__obj.toLocaleString(),
     37  '__obj.toLocaleString() must return the same value returned by n__obj.toLocaleString()'
     38 );
     39 
     40 assert.sameValue(typeof __obj, typeof n__obj, 'The value of `typeof __obj` is expected to be typeof n__obj');
     41 
     42 var x;
     43 
     44 reportCompare(0, 0);