tor-browser

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

S15.9.3.1_A3_T4.1.js (2967B)


      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    The [[Class]] property of the newly constructed object
      7    is set to "Date"
      8 esid: sec-date-year-month-date-hours-minutes-seconds-ms
      9 description: >
     10    Test based on delete prototype.toString - 5 arguments, (year,
     11    month, date, hours, minutes)
     12 ---*/
     13 
     14 var x1 = new Date(1899, 11, 31, 23, 59);
     15 
     16 assert.sameValue(
     17  Object.prototype.toString.call(x1),
     18  "[object Date]",
     19  'Object.prototype.toString.call(new Date(1899, 11, 31, 23, 59)) must return "[object Date]"'
     20 );
     21 
     22 var x2 = new Date(1899, 12, 1, 0, 0);
     23 
     24 assert.sameValue(
     25  Object.prototype.toString.call(x2),
     26  "[object Date]",
     27  'Object.prototype.toString.call(new Date(1899, 12, 1, 0, 0)) must return "[object Date]"'
     28 );
     29 
     30 var x3 = new Date(1900, 0, 1, 0, 0);
     31 
     32 assert.sameValue(
     33  Object.prototype.toString.call(x3),
     34  "[object Date]",
     35  'Object.prototype.toString.call(new Date(1900, 0, 1, 0, 0)) must return "[object Date]"'
     36 );
     37 
     38 var x4 = new Date(1969, 11, 31, 23, 59);
     39 
     40 assert.sameValue(
     41  Object.prototype.toString.call(x4),
     42  "[object Date]",
     43  'Object.prototype.toString.call(new Date(1969, 11, 31, 23, 59)) must return "[object Date]"'
     44 );
     45 
     46 var x5 = new Date(1969, 12, 1, 0, 0);
     47 
     48 assert.sameValue(
     49  Object.prototype.toString.call(x5),
     50  "[object Date]",
     51  'Object.prototype.toString.call(new Date(1969, 12, 1, 0, 0)) must return "[object Date]"'
     52 );
     53 
     54 var x6 = new Date(1970, 0, 1, 0, 0);
     55 
     56 assert.sameValue(
     57  Object.prototype.toString.call(x6),
     58  "[object Date]",
     59  'Object.prototype.toString.call(new Date(1970, 0, 1, 0, 0)) must return "[object Date]"'
     60 );
     61 
     62 var x7 = new Date(1999, 11, 31, 23, 59);
     63 
     64 assert.sameValue(
     65  Object.prototype.toString.call(x7),
     66  "[object Date]",
     67  'Object.prototype.toString.call(new Date(1999, 11, 31, 23, 59)) must return "[object Date]"'
     68 );
     69 
     70 var x8 = new Date(1999, 12, 1, 0, 0);
     71 
     72 assert.sameValue(
     73  Object.prototype.toString.call(x8),
     74  "[object Date]",
     75  'Object.prototype.toString.call(new Date(1999, 12, 1, 0, 0)) must return "[object Date]"'
     76 );
     77 
     78 var x9 = new Date(2000, 0, 1, 0, 0);
     79 
     80 assert.sameValue(
     81  Object.prototype.toString.call(x9),
     82  "[object Date]",
     83  'Object.prototype.toString.call(new Date(2000, 0, 1, 0, 0)) must return "[object Date]"'
     84 );
     85 
     86 var x10 = new Date(2099, 11, 31, 23, 59);
     87 
     88 assert.sameValue(
     89  Object.prototype.toString.call(x10),
     90  "[object Date]",
     91  'Object.prototype.toString.call(new Date(2099, 11, 31, 23, 59)) must return "[object Date]"'
     92 );
     93 
     94 var x11 = new Date(2099, 12, 1, 0, 0);
     95 
     96 assert.sameValue(
     97  Object.prototype.toString.call(x11),
     98  "[object Date]",
     99  'Object.prototype.toString.call(new Date(2099, 12, 1, 0, 0)) must return "[object Date]"'
    100 );
    101 
    102 var x12 = new Date(2100, 0, 1, 0, 0);
    103 
    104 assert.sameValue(
    105  Object.prototype.toString.call(x12),
    106  "[object Date]",
    107  'Object.prototype.toString.call(new Date(2100, 0, 1, 0, 0)) must return "[object Date]"'
    108 );
    109 
    110 reportCompare(0, 0);